Skip to main content

a python library for retrieving company public data in thailand. It has its own public database for caching, so, it is really fast, smart, and save lot of time and energy.

Project description

borisat

a python library for retrieving company public data in thailand. It has its own public database for caching, so, it is really fast, smart, and save lot of time and energy.

Get Started

pip install borisat
import borisat

a_valid_tax_id = tax_id = '0105558096348'

if borisat.is_exist(tax_id):
    company = borisat.get_info(tax_id=tax_id) 
    print(company)
# NID='0105558096348' title_name='บริษัท' name='โฟลว์แอคเคาท์ จำกัด' surname='-' branch_name='โฟลว์แอคเคาท์ จำกัด' branch_number=0 branch_title_name='บริษัท' business_first_date='2016/04/07' building_name='ชุดสกุลไทย สุรวงศ์ ทาวเวอร์' floor_number='11' room_number='12B' village_name='-' house_number='141/12' moo_number='-' soi_name='-' street_name='สุรวงศ์' thambol='สุริยวงศ์' amphur='บางรัก' province='กรุงเทพมหานคร' post_code='10500'

another_valid_tax_id = tax_id = "0994000160097"
company = borisat.get_info(tax_id=tax_id) 
print(company)
# NID='0994000160097' title_name='มหาวิทยาลัย' name='เทคโนโลยีพระจอมเกล้าธนบุรี' surname='-' branch_name='กลุ่มงานส่งเสริมและบริการวิจัย' branch_number=0 branch_title_name='-' business_first_date='2013/09/17' building_name='สำนักงานอธิการบดี' floor_number='-' room_number='-' village_name='-' house_number='126' moo_number='-' soi_name='-' street_name='ประชาอุทิศ' thambol='บางมด' amphur='ทุ่งครุ' province='กรุงเทพมหานคร' post_code='10140'

Why it is the way it is?

  1. the government public api is obsolete, doc is unclear and this is 2020, and it is SOAP api. OMG. thus, we need some kinds of modern interface.
  2. retriving data from the government public api is F**king slow in the business hours. thus, we need some kinds of cache. a public one where who use this lib could enjoy.

A public cache?

There is no such thing as a public cache/database. There is a close thing.

  1. Public Google BigQuery
  2. Smart contact. Blockchain

being a cache key value access is so critical. if you use BigQuery to query for a single row, since it is a column-based db in will cost a lot when your database get bigger, very costly. and to let other have your write-only key to the database is nut.

on surface Blockchain seems legit. there is a mapping data type on solidity. Wow, this might be a way to go. I took my word back when I saw a blog, No, you don’t store data on the blockchain – here’s why 1MB for 700 Dollars, holy cow! I knows that there is a hashgraph blockchain. the price is great, but there is no official python support + the unofficial is 2 years old of unmaintain.

ok then, my last combo would be create a cache serverless api + store on a serverless database which I pay myself and let the lib call my fast api first, if there is no data, call the gov server, then lib call my api to store the cache. open source everything that is my experiment.

Roadmap

See project board

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

borisat-1.0.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

borisat-1.0.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file borisat-1.0.0.tar.gz.

File metadata

  • Download URL: borisat-1.0.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.2 CPython/3.8.6 Windows/10

File hashes

Hashes for borisat-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ff8b4f30213455033535d156ed8a93c41127e2041166ad8493036ef8483dca74
MD5 5c5925819976a4441abd892545bc8463
BLAKE2b-256 6d3c8b0add910d68935cbe278f540aa410fa2854df250f5a99cf5961bfe167ec

See more details on using hashes here.

File details

Details for the file borisat-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: borisat-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.2 CPython/3.8.6 Windows/10

File hashes

Hashes for borisat-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8bafd1b03456b6ddba206dd3dbc939234c8c6f0bc4c8167d7577049614e8a96
MD5 9cca16c79446d6c0abe9f73c826d7e53
BLAKE2b-256 c4ae3d844504828d01dff583ebcb19cd1207daeebaf3a477f70a49748f94e1ad

See more details on using hashes here.

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