Giter VIP home page Giter VIP logo

dalton's Introduction

Dalton

PyPI GitHub Documentation Status Codacy Badge CI Workflow

Note that this is an alpha release of the project, and large changes may occur, however it is intended to keep the access paths to functions and classes the same.

This Python package provides a wrapper providing read-only access to the Atomic Assets API on the WAX blockchain. Full docs being assembled at Read the Docs.

Features

  • Atom class for accessing Atomic Asset Data
  • Pythonic classes for Atomic Assets, Templates, Schemas, Collections, Transfer events, with
  • A growing collection of class methods for working with API data.

In development

Have a look at our roadmap here.

Installation

The recommended method of installation is through PyPI and pip

python -m pip install daltonapi

Fun fact: This package is named after John Dalton, a pioneer of Atomic Theory.

Examples

Creating an Atom object

The main class of the Dalton package is the Atom class, which is used as an interface to the API

>>> from daltonapi.api import Atom

>>> atom = Atom()

Retrieving an asset

Once you have created an Atom, it's simple to get information about an asset.

>>> my_asset = atom.get_asset("1099519242825")
>>> print(my_asset)
Asset 1099519242825: creekdrops21 -   Bitcoin #1/21 (Max Supply: 21)
>>>
>>> # get link to asset's primary image
>>> print(my_asset.image)
https://ipfs.io/ipfs/QmUn8kvvHFrJK2mSsiPFNRMmmehnRoNJsqTP4XTVsemgrc
>>>
>>> # get asset collection, which is a Collection object
>>> collection = my_asset.collection
>>> print("Author:",collection.author)
Author: creek.gm

Retrieving assets based on criteria

To get assets based on some criteria, you can use Atom.get_assets, which will return a list based on criteria passed. Currently, get_assets accepts owner, template, schema, and/or collection as either strings or Class Objects.

>>> # Get assets using owner and template as strings
>>> assets = atom.get_assets(owner="someowner123", template = "12345")
>>>
>>> # Get assets using collection class object
>>> assets = atom.get_assets(collection=my_asset.collection)

Documentation

Full documentation is being assembled at Read the Docs.

Contributing

See Contributing.

Alternatively, if you would like to sponsor me, consider donating some WAX to the address daltonpython. https://i.imgur.com/rWbgGW3.png

Attribution

Contact me

dalton's People

Contributors

stuckatsixpm avatar tendto avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.