GithubHelp home page GithubHelp logo

python-ifirma's Introduction

python-ifirma (in progress)

Extremely simple wrapper for iFirma API.

##Features

Implemented

  • generating invoice in iFirma service
  • downloading invoice PDF

Very soon

  • generating proforma invoice
  • generating invoice based on proforma

##Prerequisites

Go to your iFirma account and generate API keys of following types:

  • faktura (required)
  • abonent (optional)

Testing

iFirma offers demo account that can be used for testing and development

##Installation

Just add following line to your requirements.txt and let pip do rest of the work

-e -e git+git://github.com/DariuszAniszewski/python-ifirma.git#egg=python-ifirma

##Usage

#####1. Create instance of iFirmaAPI

ifirma_client = iFirmaAPI(TEST_IFIRMA_USER, TEST_IFIRMA_INVOICE_KEY, TEST_IFIRMA_USER_KEY)

#####2. Create invoice parameters

client = Client(
    "Dariusz Aniszewski's Company",  # company name
    "PL1231231212",  # Tax ID
    Address(
        "Otwock",  # City
        "00-000"  # Zip code
    ),
    email="[email protected]",
)

position = Position(
    VAT.VAT_23,  # VAT rate 
    1,  # Quantity
    1000.00,  # Unit total price
    "nazwa",  # Position name
    "szt"  # Position unit
)

#####3. Create invoice in iFirma service and get it's id and number

invoice = NewInvoiceParams(client, [position])
invoice_id, invoice_number = ifirma_client.generate_invoice(invoice)

#####4. Download invoice PDF In order to get PDF file with created invoice use get_invoice_pdf(invoice_id) method. It will return file handler.

pdf_file_obj = ifirma_client.get_invoice_pdf(invoice_id)

That's all folks

python-ifirma's People

Contributors

dariuszaniszewski avatar

Watchers

 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.