GithubHelp home page GithubHelp logo

bobslee / petlodoo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sferket/petlodoo

0.0 1.0 0.0 22 KB

Provice Odoo io functionality for petl

License: GNU General Public License v3.0

Python 100.00%

petlodoo's Introduction

petl_odoo

Provide Odoo io functionality for petl

Example:

import petl as etl
from petl.util.base import Table
from petlodoo.io.odoo import Odoo, fromodoo, toodoo

# Initialize connection to Odoo
odoo = Odoo('http://10.200.12.20:8069', 'test', 'admin', 'admin')

# Get data from Odoo
table1 = fromodoo(odoo, 'product.template', [], ['name', 'standard_price', 'create_date'])
print table1
# Or in case we have unicode
print table1.__unicode__

# Remove columns from data set
table2 = etl.cutout(table1, 'standard_price', 'create_date')
print table2

# Rename all products in set
table3 = etl.convert(table2, 'name', lambda v: v+'(2)')
print table3

# Write set back to Odoo
toodoo(table3, odoo, 'product.template', batch=500, tracking_disable=True)

# Argument raw_data returns Python objects instead of default string values.
# Several types can be marshelled/unmarshelled from XML to Python.
# See: https://docs.python.org/3/library/xmlrpc.client.html
# Set `raw_data` argument (6th position) to True, to get Python objects, e.g. int, datetime.
table4 = fromodoo(odoo, 'product.template', [], ['name', 'standard_price', 'create_date'], True)
print table4

petlodoo's People

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.