Skip to main content
python-subledger
================

Python implementation of the Subledger.com API for double entry accounting

Documentation and API endpoint: https://api.subledger.com/

### Beware ###
This library is experimental and unfinished. Do not rely on it (yet).

Feel free to suggest code changes or features!

The base for working with Subledger is an Organization. You can get yourself an
identity (user) with Subledger. With this identity and an API key, you can
create an Organization. The Organization will house accounting Books and journal
entries.

Implemented:
* Organization
* Book
* Account
* JournalEntry

Todo:
* Switch to v2: https://api.subledger.com/v2/
* Fix broken tests
* Implement Category
* Implement Report

Nice to hace:
* Implement Identity
* ReportRenderings

## Usage ##

from subledger import Book, Organization

# Authenticate with your Subledger credentials
Book.authenticate(api_key, api_secret)

# Use your organization to browse the books and accounts
org = Organization.from_id('<your org ID>')
for book in Book.all(org):
print book

# Create a new book and archive it immediately
book = Book(org, 'USD')
book.save()
print len(list(Book.all(org))), 'active books'
print len(list(Book.all(org, state='archived'))), 'archived books'

book.archive()
print len(list(Book.all(org))), 'active books'
print len(list(Book.all(org, state='archived'))), 'archived books'


## Class pattern ##

### SubledgerBase ###
All models derive from SubledgerBase
#### .authenticate(key_id, secret)
Register your API key credentials to get access to the Subledger API.

#### .from_id(id_)
Create the instance by loading the data from Subledger.

#### .from_dict(dict)
Create the instance from the given dict without requests to Subledger.

#### .save()
Write the values to Subledger.

It will not save data recursively. For example;
book.save()
will **not** save changes made to book.organization

### Organization ###
#### .from_id(org_id)

### Book ###
#### .from_id(book_id, org_id)
#### .organization
The Organization object this Book belongs to.

### Account ###
#### .from_id(account_id, org_id, book_id)
#### .book
The Book object this Account belongs to.

Metadata

Release files for python-subledger 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-subledger 0.1
File Size Uploaded Provenance Actions
python-subledger-0.1.zip 8.3 kB Without provenance Details for python-subledger-0.1.zip

Release files / python-subledger-0.1.zip

Download URL python-subledger-0.1.zip
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f81b491cf662b1b146eddaf2719d0a4b862fca68ead2430638452ebd693a4540
BLAKE2b-256 checksum
How to use checksums
41537adb907cd82d3e572a80f219a09f29baa60f21506d71a900c4067f638ea0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for python-subledger 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page