Skip to main content

The Python interface to Ledger Investing's analytics infrastructure

Project description

LedgerAnalytics Python

ledger-analytics is the Python interface to Ledger Investing's remote analytics infrastructure.

To use with a local app (which should be running on localhost:8000), set your LEDGER_ANALYTICS_API_KEY environment variable.

The typical Python workflow is, then:

from ledger_analytics import AnalyticsClient
from bermuda import meyers_tri

client = AnalyticsClient()

triangle = client.triangle.get()

# Get the Bermuda Triangle object
bermuda_triangle = triangle.get()

# Fit a development model
dev_model = client.development_model.fit(
   config={
       "triangle_name": "meyers",
       "model_name": "chain_ladder",
       "model_type": "ChainLadder",
       "model_config": {},
    }
)

# delete triangle
triangle.delete()

The LegderAnalytics class can also be used as a simple context manager:

from ledger_analytics import LedgerAnalytics

with AnalyticsClient() as client:
    triangle = client.triangle.create(
        config={
            "triangle_name": "test_meyers_triangle",
            "triangle_data": meyers_tri.to_dict(),
        )
    )
    triangle.delete()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ledger_analytics-0.0.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ledger_analytics-0.0.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file ledger_analytics-0.0.1.tar.gz.

File metadata

  • Download URL: ledger_analytics-0.0.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for ledger_analytics-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e59c7ecf2110135832c4ef78abd3696b388222c9d9bf517a85ffd102a55e16f9
MD5 7e8d1a2e33330004427bfa7d4ee680c5
BLAKE2b-256 30ee8ada653c97e13818250383750869eec45cef8694e14b9ad515e075d7b876

See more details on using hashes here.

File details

Details for the file ledger_analytics-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ledger_analytics-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 358d3ed26d9bccc29379a30b5f4728152e46254f784e77108423b8dcb702d658
MD5 f7318752433d325d58f97a853668955e
BLAKE2b-256 404000383b20db87664a4efd76172bb97ba0d6340500b7b8c4823535c9d6fd5d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page