Saravanan666/pypi-org huggingface dataset:
Package: sheetsorm
SheetsORMSheetsORM is a simple micro ORM extension for gspread.Features:Create a entity class for each worksheetColumns are mapped to attributesRepository: Add,Remove,Update operationsType checking for attributesRequirementsPython 3.9+Installationpip install sheetsormBasic usage1.Create credentials in Google API Console2.Creating an instance:fromsheetsorm.ormimportSheetsORM# Create a SheetsORM instancegs=SheetsORM(scope=['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive'],credentials_file='./credentials.json',# pass the path of the credentials file, or google drive URLis_url=False,# True if the credentials file is a google drive URLspreadsheet_name='DEV'# pass the name of the spreadsheet)# if the spread sheet is not found, it will be createdgs.connect()# You should share the spreadsheet with your preferred email addressgs.share('your@email.com','user','owner')3.Create a class for each worksheet:fromsheetsorm.decoratorsimportentity,columnfromdatetimeimportdatetime# define the entity# the worksheet name by default is the class name@entity(worksheet='Kat')classKat:# our primary key auto_increment with non-nullable values# name defines the column name in the worksheet, by default it is the attribute nameid=column(int,name='ID',primary_key=True,increment=True,required=True)# pass the length of the column as argument to 'str'name=column(str(200),name='NAME',required=True)# or use as a stringcolor=column('20',name='COLOR')# the entity decorator add a new constructor that allows you to create an instance# from key valuesmeow=Kat(name='Meow',birth_date=datetime(2019,1,1),color='black')repo=gs.get_repository(Kat)# add the objectrepo.add(meow)# and then commit the changesrepo.commit()# pass lambda function to filter the resultsfind_meow=repo.find(lambdax:x.name=='Meow')iflen(find_meow)==1:print('I Found Meow')print(f'His id:{find_meow[0].id}')print(f'His name:{find_meow[0].name}')print(f'His birth date:{find_meow[0].birth_date}')print(f'His color:{find_meow[0].color}')else:print('I did not find Meow')meow=find_meow[0]meow.name='Meow2'# Runtime type checkings# meow.color  = 1  # TypeError: color must be of type 'str'repo.update(meow)repo.commit()# Remove the row from the worksheetrepo.remove()repo.commit()# Other functions to use:# repo.all(lambda x: x.color=='orange')# repo.any(lambda x: x.name=='Mr. Potato')
Package: sheet-sql
sheet-sqlsheet-sql allows for writing SQL-style queries to query data from Google Sheets.
It makes use of Google's Table Query (tq) Language. Seeherefor more details.>>> from sheetsql import connect
>>> gs = connect("service_account")
>>> gs.spreadsheets
[<Spreadsheet 'Test' id:1z2917zfaUqeE9-fMn-XAUvDwzQ8Q_2rEXHRst5KZC3I>, <Spreadsheet 'my new spreadsheet' id:1I4pfBHYoY_ajW13Tn8t2-AyqmWK1HzcJPccyRUefdyw>]
>>> spreadsheet = gs['1z2917zfaUqeE9-fMn-XAUvDwzQ8Q_2rEXHRst5KZC3I']
>>> spreadsheet
<Spreadsheet 'Test' id:1z2917zfaUqeE9-fMn-XAUvDwzQ8Q_2rEXHRst5KZC3I>
>>> spreadsheet.worksheets
['Sheet1', 'Sheet2']
>>> worksheet = spreadsheet['Sheet1']
>>> worksheet
<Worksheet 'Sheet1' id:0>
>>> worksheet.columns
['test', 'test2', 'test3']
>>> query = worksheet.query("SELECT *")
<generator object Worksheet._result_handler.<locals>.<genexpr> at 0x7fe86c3c2840>
>>> for row in query:
...   print(row)
...
{'test': 1.0, 'test2': 6.0, 'test3': 11.0}
{'test': 2.0, 'test2': 7.0, 'test3': 12.0}
{'test': 3.0, 'test2': 8.0, 'test3': 13.0}
{'test': 4.0, 'test2': 9.0, 'test3': 14.0}
{'test': 5.0, 'test2': 10.0, 'test3': 15.0}
>>> worksheet.default_row_type
<class 'dict'>
>>> worksheet.default_row_type = list
>>> worksheet.default_row_type
<class 'list'>
>>> query = worksheet.query("SELECT *")
>>> for row in query:
...   print(row)
...
[1.0, 6.0, 11.0]
[2.0, 7.0, 12.0]
[3.0, 8.0, 13.0]
[4.0, 9.0, 14.0]
[5.0, 10.0, 15.0]To install, runpip install sheet-sqlAlternatively, install withpoetrypoetry add sheet-sql
Package: sheetsync
A python library to create, update and delete rows of data in a google spreadsheet.Click here to read the full documentation.InstallationInstall from PyPi usingpip:pip install sheetsyncOr you can clone the git repo and install from the code:git clone git@github.com:mbrenig/sheetsync.git LocalSheetSync
pip install LocalSheetSyncNote, you may need to run the commands above withsudo.Setting up OAuth 2.0 accessThe Google Drive API now requires the use of OAuth2.0. This means you will need
to go through a bit of configuration to get an API Client ID and Client Secret
before using sheetsync.Read the step-by-stepgetting started guidefor instructions.Injecting data to a Google sheetSheetSync works with data in a dictionary of dictionaries. Each row is
represented by a dictionary, and these are themselves stored in a dictionary
indexed by a row-specific key. For example this dictionary represents two rows
of data each with columns “Color” and “Performer”:data={"Kermit":{"Color":"Green","Performer":"Jim Henson"},"Miss Piggy":{"Color":"Pink","Performer":"Frank Oz"}}To insert this data (add or update rows) into a target
worksheet in a google spreadsheet doc use this code:importloggingfromsheetsyncimportSheet,ia_credentials_helper# Turn on logging so you can see what sheetsync is doing.logging.getLogger('sheetsync').setLevel(logging.DEBUG)logging.basicConfig()# Create OAuth2 credentials, or reload them from a local cache file.CLIENT_ID='171566521677-3ppd15g5u4lv93van0eri4tbk4fmaq2c.apps.googleusercontent.com'CLIENT_SECRET='QJN*****************hk-i'creds=ia_credentials_helper(CLIENT_ID,CLIENT_SECRET,credentials_cache_file='cred_cache.json')data={"Kermit":{"Color":"Green","Performer":"Jim Henson"},"Miss Piggy":{"Color":"Pink","Performer":"Frank Oz"}}# Find or create a spreadsheet, then inject data.target=Sheet(credentials=creds,document_name="sheetsync Getting Started")target.inject(data)print"Spreadsheet created here:%s"%target.document_hrefThe first part of this script imports theSheetobject andia_credentials_helperfunction. This function is included to help you quickly
generate anOAuth2Credentialsobject using your Client ID and Secret.The second part creates a new spreadsheet document in your google drive and then inserts the data like so:Later on you’ll probably want to access this data, to do that note the
spreadsheet’s document key from the URL:and access the data as follows:source=Sheet(credentials=creds,document_key="1bnieREGAyXZ2TnhXgYrIacCIY09Q2lfGXNZbjsvJ82M",worksheet_name='Sheet1')printsource.data()The ‘inject’ method only adds or updates rows. If you want to delete rows from the spreadsheet to keep it in sync with the input data then use the ‘sync’ method.Full documentationIs availablehere.Testing and developmentSheetSync comes with tox tests. To run them, you’ll need to copy the .secret
file to .mysecrets and fill in your own Client ID, Secret and Testdoc folder
key. Then run with the following two commands:. .mysecrets
toxThe license is MIT so feel free to edit, improve. Cheers.
Package: sheetsync2
Apython 2.7library to create, update and delete rows of data in a google spreadsheet.Click here to read the full documentation.InstallationInstall from PyPi usingpip:pip install sheetsync2Or you can clone the git repo and install from the code:git clone -b master27 git@github.com:mbrenig/sheetsync.git LocalSheetSync
pip install LocalSheetSyncNote, you may need to run the commands above withsudo.Setting up OAuth 2.0 accessThe Google Drive API now requires the use of OAuth2.0. This means you will need
to go through a bit of configuration to get an API Client ID and Client Secret
before using sheetsync.Read the step-by-stepgetting started guidefor instructions.Injecting data to a Google sheetSheetSync works with data in a dictionary of dictionaries. Each row is
represented by a dictionary, and these are themselves stored in a dictionary
indexed by a row-specific key. For example this dictionary represents two rows
of data each with columns “Color” and “Performer”:data={"Kermit":{"Color":"Green","Performer":"Jim Henson"},"Miss Piggy":{"Color":"Pink","Performer":"Frank Oz"}}To insert this data (add or update rows) into a target
worksheet in a google spreadsheet doc use this code:importloggingfromsheetsyncimportSheet,ia_credentials_helper# Turn on logging so you can see what sheetsync is doing.logging.getLogger('sheetsync').setLevel(logging.DEBUG)logging.basicConfig()# Create OAuth2 credentials, or reload them from a local cache file.CLIENT_ID='171566521677-3ppd15g5u4lv93van0eri4tbk4fmaq2c.apps.googleusercontent.com'CLIENT_SECRET='QJN*****************hk-i'creds=ia_credentials_helper(CLIENT_ID,CLIENT_SECRET,credentials_cache_file='cred_cache.json')data={"Kermit":{"Color":"Green","Performer":"Jim Henson"},"Miss Piggy":{"Color":"Pink","Performer":"Frank Oz"}}# Find or create a spreadsheet, then inject data.target=Sheet(credentials=creds,document_name="sheetsync Getting Started")target.inject(data)print"Spreadsheet created here:%s"%target.document_hrefThe first part of this script imports theSheetobject andia_credentials_helperfunction. This function is included to help you quickly
generate anOAuth2Credentialsobject using your Client ID and Secret.The second part creates a new spreadsheet document in your google drive and then inserts the data like so:Later on you’ll probably want to access this data, to do that note the
spreadsheet’s document key from the URL:and access the data as follows:source=Sheet(credentials=creds,document_key="1bnieREGAyXZ2TnhXgYrIacCIY09Q2lfGXNZbjsvJ82M",worksheet_name='Sheet1')printsource.data()The ‘inject’ method only adds or updates rows. If you want to delete rows from the spreadsheet to keep it in sync with the input data then use the ‘sync’ method.Full documentationIs availablehere.Testing and developmentSheetSync comes with tox tests. To run them, you’ll need to copy the .secret
file to .mysecrets and fill in your own Client ID, Secret and Testdoc folder
key. Then run with the following two commands:. .mysecrets
toxThe license is MIT so feel free to edit, improve. Cheers.
Package: sheetsync3
A python3 compatible fork ofmbrenig/SheetSync.A python library to create, update and delete rows of data in a google spreadsheet.Click here to read the full documentation.InstallationInstall from PyPi usingpip:pip install sheetsync3Or you can clone the git repo and install from the code:git clone git@github.com:samdfonseca/sheetsync.git sheetsync3
pip install sheetsync3Note, you may need to run the commands above withsudo.Setting up OAuth 2.0 accessThe Google Drive API now requires the use of OAuth2.0. This means you will need
to go through a bit of configuration to get an API Client ID and Client Secret
before using sheetsync.Read the step-by-stepgetting started guidefor instructions.Injecting data to a Google sheetSheetSync works with data in a dictionary of dictionaries. Each row is
represented by a dictionary, and these are themselves stored in a dictionary
indexed by a row-specific key. For example this dictionary represents two rows
of data each with columns “Color” and “Performer”:data={"Kermit":{"Color":"Green","Performer":"Jim Henson"},"Miss Piggy":{"Color":"Pink","Performer":"Frank Oz"}}To insert this data (add or update rows) into a target
worksheet in a google spreadsheet doc use this code:importloggingfromsheetsyncimportSheet,ia_credentials_helper# Turn on logging so you can see what sheetsync is doing.logging.getLogger('sheetsync').setLevel(logging.DEBUG)logging.basicConfig()# Create OAuth2 credentials, or reload them from a local cache file.CLIENT_ID='171566521677-3ppd15g5u4lv93van0eri4tbk4fmaq2c.apps.googleusercontent.com'CLIENT_SECRET='QJN*****************hk-i'creds=ia_credentials_helper(CLIENT_ID,CLIENT_SECRET,credentials_cache_file='cred_cache.json')data={"Kermit":{"Color":"Green","Performer":"Jim Henson"},"Miss Piggy":{"Color":"Pink","Performer":"Frank Oz"}}# Find or create a spreadsheet, then inject data.target=Sheet(credentials=creds,document_name="sheetsync Getting Started")target.inject(data)print("Spreadsheet created here:{}".format(target.document_href))The first part of this script imports theSheetobject andia_credentials_helperfunction. This function is included to help you quickly
generate anOAuth2Credentialsobject using your Client ID and Secret.The second part creates a new spreadsheet document in your google drive and then inserts the data like so:Later on you’ll probably want to access this data, to do that note the
spreadsheet’s document key from the URL:and access the data as follows:source=Sheet(credentials=creds,document_key="1bnieREGAyXZ2TnhXgYrIacCIY09Q2lfGXNZbjsvJ82M",worksheet_name='Sheet1')printsource.data()The ‘inject’ method only adds or updates rows. If you want to delete rows from the spreadsheet to keep it in sync with the input data then use the ‘sync’ method.Full documentationIs availablehere.Testing and developmentSheetSync comes with tox tests. To run them, you’ll need to copy the .secret
file to .mysecrets and fill in your own Client ID, Secret and Testdoc folder
key. Then run with the following two commands:. .mysecrets
toxThe license is MIT so feel free to edit, improve. Cheers.
Package: sheetwhat
sheetwhatsheetwhatenables you to write Submission Correctness Tests (SCTs) for interactive Spreadsheet exercises on DataCamp.If you are new to teaching on DataCamp, check outhttps://instructor-support.datacamp.com.If you want to learn what SCTs are and how they work, visitthis articlespecifically.For a complete overview of all functionality insidesheetwhatand articles about what to use when, consulthttps://sheetwhat.readthedocs.io.Installingpip install sheetwhatDemoSheetwhat is typically used in a web application, but you can also experiment with its functions on your local machine.
SCT functions that fail will throw aTestFailerror.# Setup: make all checking functions availablefromsheetwhat.sct_syntaximportSCT_CTXglobals().update(SCT_CTX)# Setup: set up state with student data, solution data and SCT rangefromsheetwhat.StateimportStatefromprotowhat.ReporterimportReporterEx.root_state=State({'values':[["a","a"]],"formulas":[["=B1"]]},{'values':[["b","b"]],"formulas":[["=B1"]]},"A1",Reporter())# Experiment interactively with SCTs# Passes, as formulas at A1 matchEx().has_equal_formula()# Fails, as values at A1 do not matchEx().has_equal_value()Testingpip install -r requirements.txt
pip install -e .
pytestLicense
Package: sheetwork
sheetwork 💩🤦What is sheetwork?sheetwork is a handy open-source CLI-tool that allows non-coders to ingest Google Spreadsheets directly into their databases with control over data types, renaming, basic data sanitisation etc.It offers a "close to no code" workflow that can still live alongside your codebase as all configuration lives in text files and is easily version-controllable. This makes it an ideal tool for teams.⚠️warningsheetworkis still in its early inception (don't get fooled by the 1 in the version). Please do some testing before you end up using it in production, and feel free to report bugs.compatibility:Python: 3.6, 3.7, 3.8
OS: Mac OSX >10.14, LinuxSo far all our unit tests work on Windows (tested in GitHub Actions) but no comprehensive testing has been done on this platform.sheetwork currently only offers support for cloud database Snowflake. However, its design follows an adapter pattern (currently in the making) and can be extended to interact with most databases. Feel free to check how you cancontributeto the project or reach out onDiscord..Why use sheetwork?Getting google sheets into any database often requires writing custom Python code that interacts with the Google API. That's fine if you can write Python, but it may not always be an option. On top of that, if your workflow requires you to ingest a bunch of sheets you may find yourselfwriting the same boiler plate code over and over.Sheetwork offers a way to bring some DRY practices, standardisation, and simplification to basic google sheet ingestion.It won't do a lot of transformations and doesn't have room for baking in much transformational logic because we believe this is best done by fully-fledged ETL open-source tools such asdbt.🙋🏻‍♂️Want to usesheetworkon other databases? Let's talk!(Make an issue, or ping me onDiscord)Installation & DocumentationHead over to the prettydocumentation.
Package: shein-django-jaeger-middleware
shein-django-jaeger-middlewareshein 运维开发部专用的django jeager middlewareInstalling$pipinstallshein-django-jaeger-middleware将shein_django_jaeger_middleware.middleware.JaegerMiddleWare添加到setting.py文件的MIDDLEWARE中例如:MIDDLEWARE = [
	...
	'shein_django_jaeger_middleware.middleware.JaegerMiddleware'
]在配置文件中cfg.ini中添加配置信息[jaeger]
service_name = your_service
reporting_host = your_jaeger_ip
reporting_port = your_jaeger_udp_portGetting Started从shein_django_jaeger_middleware引入requests，如原requests库一样使用fromshein_django_jaeger_middlewareimportrequestsreq=requests.get(url,headers=headers)Enjoy!如有问题请联系我：zhpan188@gmail.com
Package: shekels
IntroductionShekels is a local service which consumes a transactions CSV file downloaded
from mint.intuit.com. It conforms this data into a database, and displays it as
a searchable table and dashboard of configurable plots in web frontend.Seedocumentationfor details.InstallationPythonpip install shekelsDockerInstalldockerInstalldocker-machine(if running on macOS or Windows)docker pull thenewflesh/shekels:[version]docker run --name shekels-prod --volume [path to shekels directory]:/mnt/storage --publish 5000:80 thenewflesh/shekels:[version]Docker For DevelopersInstalldockerInstalldocker-machine(if running on macOS or Windows)Ensure docker-machine has at least 4 GB of memory allocated to it.git clone git@github.com:theNewFlesh/shekels.gitcd shekelschmod +x bin/shekelsbin/shekels startThe service should take a few minutes to start up.Runbin/shekels --helpfor more help on the command line tool.
Package: shekhar-bmi-calculator
This is a very simple bodymassindex calculator with two parameters ‘height’ and ‘weight’. This function returns the calculation of weight in ‘kg’ divided by the square of the height in ‘meters’, which is the formula of the Body Mass Index(BMI). The round() function is used in order to round the result to 2 decimal points.Change Log0.0.1 (22/04/2023)First Release
Package: shela-shelo
Make sure you have upgraded version of pipWindowspy -m pip install --upgrade pipLinux/MAC OSpython3 -m pip install --upgrade pipCreate a project with the following structurepackaging_tutorial/
├── LICENSE
├── pyproject.toml
├── README.md
├── setup.cfg
├── src/
│   └── example_package/
│       ├── __init__.py
│       └── example.py
└── tests/
touch LICENSE
touch pyproject.toml
touch setup.cfg
mkdir src/mypackage
touch src/mypackage/__init__.py
touch src/mypackage/main.py
mkdir testspyproject.tomlThis file tells tools like pip and build how to create your project[build-system]
requires = [
    "setuptools>=42",
    "wheel"
]
build-backend = "setuptools.build_meta"build-system.requires gives a list of packages that are needed to build your package. Listing something here will only make it available during the build, not after it is installed.build-system.build-backend is the name of Python object that will be used to perform the build. If you were to use a different build system, such as flit or poetry, those would go here, and the configuration details would be completely different than the setuptools configuration described below.Setup.cfg setupUsing setup.cfg is a best practice, but you could have a dynamic setup file using setup.py[metadata]
name = example-pkg-YOUR-USERNAME-HERE
version = 0.0.1
author = Example Author
author_email = author@example.com
description = A small example package
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/pypa/sampleproject
project_urls =
    Bug Tracker = https://github.com/pypa/sampleproject/issues
classifiers =
    Programming Language :: Python :: 3
    License :: OSI Approved :: MIT License
    Operating System :: OS Independent

[options]
package_dir =
    = src
packages = find:
python_requires = >=3.6

[options.packages.find]
where = srcRunning the buildMake sure your build tool is up to dateWindowspy -m pip install --upgrade buildLinux/MAC OSpython3 -m pip install --upgrade buildCreate the buildpy -m buildUpload to pypitwine upload dist/*Referenceshttps://packaging.python.org/tutorials/packaging-projects/
Package: shelchemy
shelchemy - Dict-like (shelve-like) storage wrapper for any DBMS (SQLAlchemy)Python installationfrom package# Set up a virtualenv.python3-mvenvvenvsourcevenv/bin/activate# Install from PyPIpipinstallshelchemyfrom sourcegitclonehttps://github.com/shelchemy/shelchemycdshelchemy
poetryinstallExamplesThis library is more useful when used along withhdict.
Here are some possible usages by itself.Scheduling jobs.fromtimeimportsleepfromshelchemy.schedulerimportScheduler# Jobs can be distributed across multiple computers/networks.names1=["a","b"]names2=["c"]names3=["d","e"]storage={}# `storage` can be: shelve; URI pointing to a database; or, any dict-like object.#   Example of a local database: storage="sqlite+pysqlite:////tmp/sqla-test.db"#   Example of a remote database: storage="mysql+pymysql://user1:password1@hosh.page/db1"fornameinScheduler(storage,timeout=10)<<names1<<names2<<names3:print(f"Processing{name}")sleep(0.1)print(f"{name}processed!")"""2023-11-13 00:03:40.115637 'a' is new, startingProcessing aa processed!2023-11-13 00:03:40.316130 'a' done2023-11-13 00:03:40.326101 'b' is new, startingProcessing bb processed!2023-11-13 00:03:40.526549 'b' done2023-11-13 00:03:40.534599 'c' is new, startingProcessing cc processed!2023-11-13 00:03:40.735062 'c' done2023-11-13 00:03:40.745734 'd' is new, startingProcessing dd processed!2023-11-13 00:03:40.946152 'd' done2023-11-13 00:03:40.957263 'e' is new, startingProcessing ee processed!2023-11-13 00:03:41.157701 'e' done"""Persistent dict.fromshelchemyimportsopenfromshelchemy.cacheimportCached=Cache("sqlite+pysqlite:////tmp/sqla-test.db")d["x"]=5d["b"]=Noneprint(d["x"],d["b"])"""5 None"""try:d["xxx"]exceptKeyErrorasm:print(m)"""'xxx'"""fork,vind.items():print(k,v)print("x"ind)"""872d417d62b78366a71ab9fee25f14dc Noneaed0339093d97301965a4e23dac3424a b'only bytes when autopack=False'a b'by'x 5b NoneTrue"""deld["x"]print("x"ind)"""False"""print(d)"""{'872d417d62b78366a71ab9fee25f14dc': None, 'aed0339093d97301965a4e23dac3424a': b'only bytes when autopack=False', 'a': b'by', 'b': None}"""# Using a context manager.withsopen()asdb:print("x"indb)print(db)db["x"]=b"asd"print(db)print(db["x"]==b"asd")print("x"indb)print(db.x==b"asd")deldb["x"]print("x"indb)db["any string key longer than 40 characters will be hashed depending if the DBMS backend is used"]=Noneprint(db)"""False{}{'x': b'asd'}TrueTrueTrueFalse{'872d417d62b78366a71ab9fee25f14dc': None}"""GrantsThis work was partially supported by Fapesp under supervision of
Prof. André C. P. L. F. de Carvalho at CEPID-CeMEAI (Grants 2013/07375-0 – 2019/01735-0).
Package: shelfdb
Shelf DBIntroductionShelf DBis a tiny document database for Python to storesdocumentsorJSON-like data.Get it$pipinstallshelfdbshelfqueryStart asyncio server$shelfdb
Servingon('127.0.0.1',17000)Database:db
pid:12359uvloop built-in already to make it faster. Seeuvloop.Sync/Async query client through network.importshelfquery# Sync client point to 127.0.0.1:17000db=shelfquery.db()# Make it async clientdb.asyncio()# Make it sync client againdb.sync()Store datadb.shelf('note').insert({'title':'Shelf DB','content':'Simple note','datetime':datetime.utcnow()})Flexible query API with similar syntaxdb.shelf('note')\.filter(lambdanote:note['title']=='Shelf DB')\.sort(key=lambdanote:note['datetime']).run()No need to learn more syntax. Let's just query usingfilter,slice,sort,map,reducewhich almost the same to Python built-in functions.Regular expressionPython reqular expressionrecan be use inside query functionimportredb.shelf('note')\.filter(lambdanote:re.match(r'.*DB$',note['title']))\.run()Tinyshelfdb ~ 12kB
    shelfquery ~ 4kBRuntime code is small, easy to install. Shelf DB also works onRaspberry Pi.