access to the HarmonySite api from python
Project description
Harmony Site
HarmonySite provides management AND a website for your choir, orchestra etc.
This package simplifies use of the Harmony Site API, from python. It was originally built for London Welsh Rugby Club Choir. If you have access to a harmony site and the appropriate permissions, you can get started (and check you have the basics working); all the information on how to do that is here.
Setup
DO NOT use your ordinary credentials for access! Get a specific login set up.
- This needs to be done by a website admin.
- Note that at present, I find it easier to create a new login than duplicate an existing one.
- It's OK to select "Not Specified" for "member"; members and logins are separate things.
- Use "Data Administration Access" - and specifiy ONLY the tables you need.
- Obviously, set a good password. Use least 16 characters, and a random password generator.
Notes
- The API is, at present, read only.
- you can book the world-famous London Welsh Rugby Club Choir for your event or come along and join us.
Where to get it
The source code is currently hosted on GitHub at: https://github.com/jonjump/harmonysite
Binary installers for the latest released version is available at the Python Package Index (PyPI).
pip install pandas
Getting Started
from harmonysite import HarmonySite
hs = HarmonySite.build("<your api url>", "<username>", "<password>")
for record in hs.browse("a table name"):
print (record)
With Pandas And Colab
A nice way to make use of the API is using Google's Colab. That way you don't have to install anything locally, and you can keep notebooks in a google drive. You may well wish to use pandas to access the API - this provides a nice way of performing operations on data tables, and works very well, particularly with colab. In order to avoid this small package pulling in a large dependency, panda code is not included, but a very simple way to do it is this ...
# get the package (because it's not in the default google colab runtime)
!pip install harmonysite
from harmonysite import HarmonySite
import pandas as pd
hs = HarmonySite.build("<your api url>", "<username>", "<password>")
def dataframe(table_name, filterColumns=None, idColumn='id'):
df = pd.DataFrame.from_records(
hs.browse(table_name, page_number=0, page_size=9999999),
index=idColumn
)
if filterColumns:
return df.filter(filterColumns)
return df
dataframe('<a table name>')
Don't Forget
Support the London Welsh Rugby Club Choir
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file harmonysite-0.0.4.tar.gz.
File metadata
- Download URL: harmonysite-0.0.4.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9f2669c5d06c2296195b3810748fdef7c07a0b34d6b4dcdd969947022b8a06d
|
|
| MD5 |
e76b1adafb4a444f36d8543dc0da4920
|
|
| BLAKE2b-256 |
2019a64aca8732c53ed72195588f47bf681aafbe4efdb2aa5f4143712b0f6f9c
|
File details
Details for the file harmonysite-0.0.4-py3-none-any.whl.
File metadata
- Download URL: harmonysite-0.0.4-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbe1cacd868cd25aac3e779891f52058a3596b42c82a85c8c61a6284c3adb2b0
|
|
| MD5 |
91e393ea496fb5275b4a18ca2233cc6f
|
|
| BLAKE2b-256 |
2ee33d6f5aaa01acb767a1216ca89ca5333ef9e3519675fb29e398f46778b6d9
|