gssetting
About
gssetting is load setting value from Google Sheets.
Installation
To install gssetting, use pip.
pip install gssetting
Examples
Google Sheets example.
| A | name | empty | value |
|---|---|---|---|
| B | test1 | none | value |
| C | test2 | ok | value ok |
Sample code
from dataclasses import dataclass
from gssetting import GoogleSpreadSheetSetting, GSSetting
@dataclass
class Setting(GSSetting):
username: str
value: str
# Same header value of sheets
headers = ["name", "value"]
if __name__ == "__main__":
gs_setting = GoogleSpreadSheetSetting(
"./service_account.json", "document_id"
)
settings = gs_setting.load("sheet_name", "A1:C3", Setting)
print(settings)
for setting in settings:
print(setting.username.value)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gssetting-0.0.1.tar.gz
(3.3 kB
view details)
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 gssetting-0.0.1.tar.gz.
File metadata
- Download URL: gssetting-0.0.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dae9e1ab1cdceb0b203ab6d133cccf524d568a8b925e5d82a0a255f0fd840a8d
|
|
| MD5 |
4a8eb99f920a4d0b7bc8e07127f4a38d
|
|
| BLAKE2b-256 |
b53a547f3c9087f8ba2c76841785b60ea14105b323d1e12b9b8c8fce242d4ded
|
File details
Details for the file gssetting-0.0.1-py3-none-any.whl.
File metadata
- Download URL: gssetting-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d542a31072523314f20777d836af7d781f72f94f3fa1101bcd8e0d5845378fee
|
|
| MD5 |
995e74b9790a7baff4aef652d274a476
|
|
| BLAKE2b-256 |
5bae860799b0b74e27f54036b721e6790c0edb75684cc1daffc2bdc1517f0b80
|