Skip to main content

A python integration to allow for quickly sending queries directly to the as400

Project description

ECMS-API

ECMS-API is a query wrapper that allows for querying the AS400 directly

Authors

Johnny Whitworth (@Poseidon-dev)

How to use Examples

Select

table = SQLQuery(HRTEMP)
query = table.select()

query.filters(employeeno=12345, companyno=50, divisionno=2)
query.columns(['CompanyNo', 'DivisionNo', 'EmployeeNo', 'City'])
query.order(by='City')
query.head()

response = query.query()

Returns the command and corresponding values:

SELECT
COMPANYNO, DIVISIONNO, EMPLOYEENO, CITY FROM CMSFIL.HRTEMP
WHERE EMPLOYEENO = '12345' AND COMPANYNO = '50' AND DIVISIONNO = '2' ORDER BY City ASC LIMIT 10

The select method also allows for queried data to be saved as an excel doc using .to_excel() rather than .query()

Update

table = SQLQuery(HRTEMP)
query = table.update()

query.sets(City='SomeCity', companyno=50)
query.filters(employeeno=12345)
query.query()

Will execute the following:

UPDATE
CMSFIL.HRTEMP
SET CITY = 'SomeCity' , COMPANYNO = '50' WHERE EMPLOYEENO = '12345'

Support

If you need some help for something, please reach out to me directly or submit an issue and I'll get to it as soon as I can

Site

https://poseidon-dev.github.io/ecms-api/

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

ecms_api-0.2.2.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

ecms_api-0.2.2-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

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