Skip to content

Open Source Product Carbon Footprint exchange platform that is PACT Conformant with the PACT Network.

Notifications You must be signed in to change notification settings

ZeroTwentyFifty/zero_twenty_fifty

Repository files navigation

branding

ZeroTwentyFifty Corporation

Enabling the exchange of product-level carbon accounting data.
Learn more »

Discussions · Blog · Solutions · Services · Newsletter

license Github Stars ClimateTech Sustainability Carbon Footprinting Pricing Help Wanted PACT Conformant

PACT conformant Badge

About

ZeroTwentyFifty’s repository represents a PACT Conformant implementation of the WBCSD Partnership for Carbon Transparency (PACT) Pathfinder Protocol. As a software company dedicated to combating climate change, we build solutions for sharing Scope 3 Product Carbon footprint data.

This project is part of our commitment to providing open-source implementations of critical pathway software, enabling organizations of all sizes to collaborate effectively in their sustainability efforts.

Getting Started

⚠️ Caution: While every effort has been made to keep the codebase in a "green" state, being an early-stage software project means some components may be unstable. Please note that if you check out the current head, things may be broken. Tagged versions will be maintained in working order.

1. Install Dependencies

From the root of the repository, run:

poetry install

2. Install Uvicorn

For Ubuntu, install Uvicorn with:

sudo apt install uvicorn

3. Activate Poetry Shell

Activate the Poetry environment to access the installed Python dependencies:

poetry shell

4. Launch the Development Server

Start the local development server with:

uvicorn main:app

5. Verify the Launch

Open your browser and navigate to:

http://127.0.0.1:8000/docs

To obtain an authentication token, go to the POST /auth/token route and enter a valid username and password in the client_id and client_secret fields. This should return an auth token and confirm that everything is working correctly.

Create Local PostgreSQL Instance

1. Connect to PostgreSQL

Connect to your local PostgreSQL instance:

psql -d postgres

2. Create the Database

Create a database called ztf:

CREATE DATABASE ztf;

3. Verify Configuration

Ensure that the values in core/config.py are set correctly for your local development environment:

POSTGRES_USER: str = os.getenv("PGUSER", "username")
POSTGRES_PASSWORD = os.getenv("PGPASSWORD", "password")
POSTGRES_SERVER: str = os.getenv("PGHOST", "localhost")
POSTGRES_PORT: str = os.getenv("PGPORT", 5432) # default PostgreSQL port is 5432
POSTGRES_DB: str = os.getenv("PGDATABASE", "ztf")

4. Provision Database Tables

Run the following command within the Poetry shell to provision the database with tables:

uvicorn main:app

If successful, you should see the database tables inside the ztf database by executing:

\dt

Setup for Local Testing

1. Create pytest.ini

Create a file named pytest.ini modeled after the env.template file. Note that this may be handled by dotenv.

2. Run Conformance Tests

By default, conformance tests are excluded from the default pytest run and executed in a separate CI/CD pipeline. To run the conformance tests, use:

pytest -m conformance

Contact us

If you need help with the software, have questions or queries, or would like to more directly engage ZeroTwentyFifty in work, please reach out to us at: [email protected]

Author

This project was created and is maintained by Louis W. If you have any questions or suggestions, feel free to reach out or open an issue on this repository.

Acknowledgements

Thanks to these wonderful people for contributing:

Chinwoke Anugwara