<jupyter_start><jupyter_text>In Brightway, a project is made of three databases: an inventory database, a biosphere database (with elementary flows and natural compartments) as well as an optional impacts characterization database. Contrary to many LCA sofltware, each project is independent and has its own databases. Hence, they can easiy be used by different brigthway installations.  This creates an empty project in your default anaconda environment<jupyter_code>import brightway2 as bw

bw.projects.create_project('a_dummy_project')<jupyter_output><empty_output><jupyter_text>Your project is created, but you're not yet inside it. This will get you into your project.<jupyter_code>bw.projects.set_current('a_dummy_project')<jupyter_output><empty_output><jupyter_text>You can check at anytime in which project you're in like so.<jupyter_code>bw.projects.current<jupyter_output><empty_output><jupyter_text>You can also check all the projects that are installed on your computer, like below. It returns a list of projects, the number of databases in each projects, and their size (in GB).<jupyter_code>bw.projects.report()<jupyter_output><empty_output><jupyter_text>Here you can check where the project you created is physically stored on your computer.  Not very convenient to find.<jupyter_code>bw.projects.output_dir<jupyter_output><empty_output><jupyter_text>And here you can ask to get a list of databases your project contains.<jupyter_code>bw.databases<jupyter_output><empty_output><jupyter_text>Which returns an empty list of databases, and that's normal since we have not imported any databases into the project.  We can now try to create a project in a more convenient location. In this case, in a Dropbox folder. For this, we need to specify the path of the project we want to create/access before we load the brightway package. You may need however to restart this notebook (kernel -> restart) so as to unload the brightway package.<jupyter_code>import os
# This retirieves your Windows username
user=os.getenv('USERNAME')
#This sets where you want the folder of your project to be.
os.environ['BRIGHTWAY2_DIR'] = "C:\\Users\\"+user+"\\Dropbox\\Example_folder\\"

#You import brightway
import brightway2 as bw

#And create/load the project
bw.projects.set_current('a_dummy_project')<jupyter_output>Using environment variable BRIGHTWAY2_DIR for data directory:
C:\Users\ros\Dropbox\Example_folder\<jupyter_text>We can now check that, indeed, your prject folder is now stored within the dropbox folder "Example_folder".<jupyter_code>bw.projects.output_dir<jupyter_output><empty_output><jupyter_text>The fact of retrieveing the Windows variable "USER" and use it in the folder path allows other users with whom the Dropbox folder is shared to run these lines without modifying the path.  When sharing a common project folder on a syncing service like Dropbox, you need to make sure that only one user is allowed to write in the project at any given time, otherwise the database may end up corrupted. To do so, you can add the line below. This line access the configuration pickle (what's a [pickle](https://pythontips.com/2013/08/02/what-is-pickle-in-python/)?) of your project (each project has a configuration pickle). If one user is working within the project, the other users will be allowed to "read" (access and see data and results), but not modify. Once the user exits the project, the other users will be allowed to write int he project.<jupyter_code>bw.config.p['lockable'] = True<jupyter_output><empty_output><jupyter_text>And finally, we can delete our project.<jupyter_code>bw.projects.delete_project("a_dummy_project", delete_dir=False)<jupyter_output><empty_output><jupyter_text>If you do not specify a name in bw.projects.delete_project(), the currently active project is deleted. If you specify delete_dir=False, only the porject name is deleted, but the data remains.  And as we can see, in the folder Example_folder, the project "a_dummy_project" is not listed anymore. Note that the project called "default" is always created when specifying a new location for project storing.<jupyter_code>bw.projects<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06748318924111431, 'fraction_numerical': 0.002881844380403458, 'mean_word_length': 6.0, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 45, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '98757', 'license': 'MIT', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1150, 'n_words': 500, 'path': '.ipynb_checkpoints/00.1_Project_create_and_locate_RS-checkpoint.ipynb', 'repo_name': 'massimopizzol/B4B', 'size': '4164'}