Skip to content

Commit

Permalink
get out of here poetry, you're way too slow
Browse files Browse the repository at this point in the history
  • Loading branch information
lhl committed Jan 13, 2025
1 parent dae7255 commit dde24ab
Showing 1 changed file with 39 additions and 19 deletions.
58 changes: 39 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
```

## Requirements
You should be familiar with and have [Python 3.8](https://www.python.org/) and [Poetry](https://python-poetry.org/) installed. We won't be providing any support for setting up your software environment. In the future, we'll be building more accessible packaged installer releases.
You should be familiar with and have [Python](https://www.python.org/) (3.9-3.12 tested). We have now switched to [PEP 621](https://peps.python.org/pep-0621/) for dependency management and recommend using `uv` for management:

We won't be providing any support for setting up your software environment, but recommend using an advanced LLM like Claude Sonnet 3.5 with grounding (loading files, search) for support.

perfi currently depends on several third party API providers (no configuration is required by default):
* [DeBank OpenAPI](https://open.debank.com/) - provides a helpful list of transaction history per chain
Expand All @@ -37,67 +39,85 @@ perfi currently depends on several third party API providers (no configuration i

## Getting Started
Here's how to install:
```
```bash
# It is up to you to handle your Python environment. I recommend either:
# mamba: https://github.com/conda-forge/miniforge?tab=readme-ov-file#requirements-and-installers
# mamba create -n perfi python=3.12
# mamba activate perfi
# pyenv: https://github.com/pyenv/pyenv-installer
# pyenv install 3.12.8
# pyenv local 3.12.8 # in the perfi folder

# You want uv
pip install uv

# Clone and install
git clone https://github.com/AUGMXNT/perfi
cd perfi
poetry install

# Install in development mode with all dependencies
uv pip install -e .

# To update dependencies to latest compatible versions
uv pip install --upgrade -e .
```

And how to run:
```
# Interactive initial perfi setup (entity, accounts, API keys)
poetry run python bin/cli.py setup
python bin/cli.py setup
# NOTE: Many commands below require an entity name to operate on.
# For the rest of these examples, we assume you have an entity named 'peepo'
# OPTIONAL: You can also add entities or addresses manually
#
# Add an entity 'peepo'
# > poetry run python bin/cli.py entity create peepo
#
python bin/cli.py entity create peepo
# Add an ethereum-style account named 'degen wallet'
# > poetry run bin/cli.py entity add_address peepo 'degen wallet' 'ethereum' '0x0000000000000000000000000000000000000000'
#
python bin/cli.py entity add_address peepo 'degen wallet' 'ethereum' '0x0000000000000000000000000000000000000000'
# You add as many wallets as you want to an entity
# Update the Coingecko price token list
poetry run python bin/update_coingecko_pricelist.py
python bin/update_coingecko_pricelist.py
# OPTIONAL: Import data from exchanges (more docs below)
# If you have data from Coinbase, Coinbase Pro, Kraken, Gemini, or Bitcoin.tax you can import this into perfi as well
# > poetry run python bin/import_from_exchange.py --entity_name peepo --file peepo-coinbase-2021-rawtx.csv --exchange coinbase --exchange_account_id peepo
python bin/import_from_exchange.py --entity_name peepo --file peepo-coinbase-2021-rawtx.csv --exchange coinbase --exchange_account_id peepo
# Import on-chain transactions
poetry run python bin/import_chain_txs.py peepo
python bin/import_chain_txs.py peepo
# Generate tx/price asset mappings - this step is key for matching like-kind assets and making sensical output
poetry run python bin/map_assets.py
python bin/map_assets.py
# Turn raw exchange/onchain txs into grouped logical/ledger txs
poetry run python bin/group_transactions.py peepo
python bin/group_transactions.py peepo
### Generally you should not need to re-run anything above this line again ###
# OPTIONAL: Set the timezone used for reporting (defaults to US/Pacific)
# Get a list of valid time zone names with:
# > poetry run python bin/cli.py setting get_timezone_names
python bin/cli.py setting get_timezone_names
# And set your reporting timezone with:
# > poetry run python bin/cli.py setting set_reporting_timezone 'Europe/Lisbon'
python bin/cli.py setting set_reporting_timezone 'Europe/Lisbon'
# Calculate costbasis lots, disposals, and income
poetry run python bin/calculate_costbasis.py peepo
python bin/calculate_costbasis.py peepo
# Generate 8949 xlsx file
poetry run python bin/generate_8949.py peepo
python bin/generate_8949.py peepo
```

### Importing data from exchanges
Today, perfi supports importing trade data from Bitcoin.tax, Coinbase, Coinbase Pro, Gemini, and Kraken.

To import data from an exchange you run the command:
```
poetry run bin/import_from_exchange.py --entity_name <peepo> --file <path/to/export/file> --exchange <coinbase|coinbasepro|gemini|kraken|bitcointax> --exchange_account_id <anything_eg_default>
python bin/import_from_exchange.py --entity_name <peepo> --file <path/to/export/file> --exchange <coinbase|coinbasepro|gemini|kraken|bitcointax> --exchange_account_id <anything_eg_default>
```

- use anything you want for the `--exchange-account-id` parameter; it's just used to help potentially differentiate multiple accounts from the same exchange
Expand Down

0 comments on commit dde24ab

Please sign in to comment.