New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

amber-electric

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amber-electric

Unofficial Amber Electric API Library

  • 0.0.17
  • PyPI
  • Socket score

Maintainers
1

Python Library for Amber Electric API

PyPI GitHub issues GitHub forks GitHub stars GitHub license Twitter

Description

Connects to the Amber Electric API and retrieves market, usage and pricing information

Note

This is in no way affiliated with Amber Electric.

Issues

I don't know what the usage data for an account looks like at the moment. Until I have an account with active usage data - this part of the API is going to be very light.

Logging / Debugging

This library uses logging just set the log level and format you need.

Example

The examples below may look a little complex - because this library relies on functions like .auth() and .update() being awaited.

See current market pricing

import asyncio
from amber_electric import AmberElectric

api = AmberElectric(
        latitude=-37.828690,
        longitude=144.997460,
    )

async def display_market_pricing():
    await api.market.update()
    print(api.market)

asyncio.get_event_loop().run_until_complete(display_market_pricing())

Get your current pricing

import asyncio
from amber_electric import AmberElectric

api = AmberElectric(
        latitude=-37.828690,
        longitude=144.997460,
		username="family@example.com",
		password="secret"
    )

async def get_account_pricing():
    await api.auth()
    await api.price.update()
    print(api.price)

asyncio.get_event_loop().run_until_complete(get_account_pricing())

Get your current usage (WIP)

import asyncio
from amber_electric import AmberElectric

api = AmberElectric(
        latitude=-37.828690,
        longitude=144.997460,
		username="family@example.com",
		password="secret"
    )

async def get_account_pricing():
    await api.auth()
    await api.usage.update()
    print(api.usage)

asyncio.get_event_loop().run_until_complete(get_account_pricing())

Support

Buy Me A Coffee

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc