Saravanan666/pypi-org huggingface dataset:
Package: python-c
python-cAn alternative to python -c with much less typing, at the price of being dirtier.Installation:$ pip install python-cUsageIf you have a file named foo.py with:def quite():
   return 5
def loud():
    print 'hello'
def double(arg):
   return arg*2Instead of:$ python -c "import foo; foo.loud();"
helloYou can now write:$ python-c foo 'loud()'
helloYou can load multiple files:$ python-c foo,foo2 'loud()'
helloor directories:$ python-c ./,./dir1,./dir2/test.py 'loud()'
helloIn cases where it works (e.g clashes between files are benign), you canminimize your typingand omit the first argument, the current directory is then loaded by default:$ python-c 'loud()'
helloPrintingPrinting is handled for you:$ python-c foo 'quite()'
5The result of the call (if any) is printed, even though the function does not call ‘print’.More examplesYou can pass arguments to your functions:$ python-c foo 'double(2)'
4You can execute arbitrary code in your single line:$ python-c foo '"hot" if double(2) == 4 else "cold"'
hotThis includes printing:$ python-c foo.py 'print "double {} is {}".format(2, double(2))'
double 2 is 4RationaleTimeis our most valuable non-possesion. The python interpreter must be clean and unambiguous, including the way it handls it’s option ‘-c’. However, more often than not, I will accept being dirty (e.g live with benign clashes between files) and simply typepython-c ‘test23()’as opposed to the double as longpython -c ‘import foo.py; foo.test23()’. Such dirty functionality should not be built into the interpreter, hencepython-c: the tool playfully indicates its motivation by saving you from typing a space between ‘python’ and ‘-c’.
Package: python-caasclient
Python client for CAASTo be filled: Brief IntroductionFeaturesHTTP interface using requestsPython native quering for CAAS API objectsInstallationUsing pip:pip install python-caasclientA virtualenvwrapper is recommended:virtualenv python-caasclient
source python-caasclient/bin/activate
pip install python-caasclientManual Installation:git clone https://github.com/rogeryu27/python-caasclient.git
cd python-caasclient
python setup.py installUsageQuery for all ready containers [in a custom namespace]:fromcaasclientimportclientascaas_clientcontainer_list=caas_client.Client(<caasurl>).containers.list()Create a self-defined image:importosfromcaasclientimportclientascaas_clientimage=caas_client.Client(<caasurl>).images.create_by_dockerfile(os.open('path/to/dockerfile','w+'))RequirementsPython 2.7requests
Package: python-cachetclient
Aboutpython-cachetclientis a client and library that can be used to communicate
with theCachetAPI.Disclaimer: This is a work in progress. Please feel free to provide feedback
and contribute to the project !DocumentationNo documentation for the time being.TL;DR: See the providedexample file.InstallingFrom source:pip install git+https://github.com/dmsimard/python-cachetclientFrom pypi:pip install python-cachetclientAuthorDavid Moreau SimardCopyrightCopyright 2016 Red Hat, Inc.Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Package: python-calamine
python-calaminePython binding for beautiful Rust's library for reading excel and odf file -calamine.Is usedcalaminepyo3maturinInstallationPypi:pip install python-calamineConda:conda install -c conda-forge python-calamineExamplefrompython_calamineimportCalamineWorkbookworkbook=CalamineWorkbook.from_path("file.xlsx")workbook.sheet_names# ["Sheet1", "Sheet2"]workbook.get_sheet_by_name("Sheet1").to_python()# [# ["1",  "2",  "3",  "4",  "5",  "6",  "7"],# ["1",  "2",  "3",  "4",  "5",  "6",  "7"],# ["1",  "2",  "3",  "4",  "5",  "6",  "7"],# ]By default, calamine skips empty rows/cols before data. For suppress this behaviour, setskip_empty_areatoFalse.frompython_calamineimportCalamineWorkbookworkbook=CalamineWorkbook.from_path("file.xlsx").get_sheet_by_name("Sheet1").to_python(skip_empty_area=False)# [# [",  ",  ",  ",  ",  ",  "],# ["1",  "2",  "3",  "4",  "5",  "6",  "7"],# ["1",  "2",  "3",  "4",  "5",  "6",  "7"],# ["1",  "2",  "3",  "4",  "5",  "6",  "7"],# ]Also, you can use monkeypatch for pandas for use this library as engine inread_excel()(only pandas 2.0 and 2.1 are supported).
Pandas 2.2 and above have built-in support of python-calamine.frompandasimportread_excelfrompython_calamine.pandasimportpandas_monkeypatchpandas_monkeypatch()read_excel("file.xlsx",engine="calamine")#            1   2   3   4   5   6   7# 0          1   2   3   4   5   6   7# 1          1   2   3   4   5   6   7Also, you can find additional examples intests.
Package: python-calendar
python-calendarInstallFrom PyPIpip install python-calendarFrom sourcerm build/ python_calendar.egg-info dist -Rf
python3 setup.py bdist_wheel
pip3 install -I dist/python_calendar-*-py3-none-any.whlHow to usefrompython_calendarimportCalendarfromdateutil.parserimportparsedate_from=parse('2023-08-23')date_to=parse('2024-08-23')calendar=Calendar.get(date_from,date_to)'Nb days :%s'%len(calendar.days)#Nb days : 366'Nb weeks :%s'%len(calendar.weeks)#Nb weeks : 53'Nb days for the 18th week in 2024 :%s'%len(calendar.nodes['2024-W18'].days)#Nb days for the 18th week in 2024 : 7'Nb months :%s'%len(calendar.months)#Nb months : 13'Nb days for Feb 2024 :%s'%len(calendar.nodes['2024-02'].days)#Nb days for Feb 2024 : 29'Nb years :%s'%len(calendar.years)#Nb years : 2'Nb days in 2024 :%s'%len(calendar.nodes['2024'].days)#Nb days in 2024 : 235calendar.days[0]# 2023-08-23calendar.days[-1]# 2024-08-22fordincalendar.nodes['2024-W34'].days:print(d.date)# 2024-08-19 00:00:00# 2024-08-20 00:00:00# 2024-08-21 00:00:00# 2024-08-22 00:00:00ContributorsAnthony K GROSShttp://anthonykgross.frhttps://twitter.com/anthonykgrosshttps://github.com/anthonykgrossCopyright and licenseCode and documentation copyright 2024. Code released underthe MIT license.
Package: python-callfire
Thin wrapper in Python which implements CallFire v2 interface definitions based on Swagger specification.UsagePython method names followCallFire’s API.
Wrapper does not introduce any additional complexity or conventions above those defined in original API,
which makes usage pretty straightforward:>>>fromcallfireimportCallFireAPI>>>api=CallFireAPI('<api-app-username>','<api-app-password>')>>>api.get_account().json(){u'email':u'your-email@your-domain.com',u'firstName':u'John',u'id':700321776,u'lastName':u'Smith',u'name':u'Metacortex',u'permissions':[u'ACCOUNT_HOLDER']}>>>text=dict(phoneNumber='13408887345',message='Hi!')>>>api.send_texts(body=[text]).json(){u'items':[{u'batchId':11428003374,u'campaignId':60000313259,u'contact':{u'id':152100378045,u'properties':{u'UNDEFINED':u'13471521003'}},u'created':1470222349000,u'finalTextResult':u'SENT',u'fromNumber':u'67076',u'id':1038052003407,u'inbound':False,u'message':u'Hi!',u'modified':1470222348000,u'records':[{u'billedAmount':1.0,u'finishTime':1470222349000,u'id':579287900394,u'message':u'Hi!',u'textResult':u'SENT'}],u'state':u'FINISHED',u'toNumber':u'13408887345'}]}>>>broadcast=dict(fromNumber='13471521003',labels=['via-api'],name='Test voice broadcast'),answeringMachineConfig='AM_AND_LIVE',recipients=[dict(phoneNumber='(347) 1521003')],sounds=dict(liveSoundText='Voice message',machineSoundText='Voice message'))>>>api.create_call_broadcast(query=dict(start=True),body=broadcast).json(){u'id':13750937003}>>>api.get_call_broadcast(13750937003).json(){u'id':13750937003,...u'status':u'FINISHED'}Error HandlingWhenever low level exception occurs it is wrapped and re-raised asCallFireError,
while original traceback preserved and displayed and original exception is also
available for inspection underwrapped_excattribute.DocumentationGenerated python methods do contain docstrings with described query and body params.
Official API documentation is available atdevelopers.callfire.com.
Package: python-caltrain
A library for working with raw Bay Area Caltrain scheduling data in
Python.What is the purpose ofpython-caltrain?The purpose of this library is for easily making queries against the
Caltrain schedule such as:The cost of travel fromSunnyvaletoSouth San Franciscostation.The next train(s) from22nd StreettoSan Jose.The duration of travel betweenSan MateoandMenlo Parkon aLimitedtrain.Does this library require an internet connection?python-caltraindoesnotrequire an internet connection, making
it easy to embed into offline applications. It relies on theCaltrain
GTFS
file,
which is updated usually a couple of times per year at most. This
library will update in accordance with announcements from Caltrain. The
version number isyear.month.revto signify how recent it is.e.g.2016.4.0means the library is at revision 0 and uses theApril
2016GTFS file.How do I get it?Install via pip:pip install python-caltrainHow do I use it?Let’s find the next train from Sunnyvale to San Francisco 4th and King.>>frompython_caltrainimportCaltrain>>c=Caltrain()>>n=c.next_trips('sunnyvale','sf')[0]>>n.departuredatetime.time(11,26)>>n.arrivaldatetime.time(12,43)>>n.durationdatetime.timedelta(0,4620)Next train is at 12:43 PM from sunnyvale. Let’s see what train number
that is.>>n.train.name'143'What kind of train is it?>>str(n.train.kind)'Local'Can you print a summary of the trip?>>str(n)[Local143]Departs:11:26:00,Arrives:12:43:00(1:17:00)Does that train stop at San Mateo? If so, when?>>san_mateo=c.get_station('san mateo')>>san_mateoinn.train.stopsTrue>>n.train.stops[san_mateo].arrivaldatetime.time(12,8)How much is this trip going to cost?>>c.fare_between('sunnyvale','san francisco')(7,75)My goodness, that’s quite expensive…What if I want to know the next train after some point in the past or
future?>>fromdatetimeimportdatetime>>d=...# Your date time here>>n=c.next_trips('sunnyvale','sf',after=d)Station names do not need to be sanitized. TheCaltrain.get_station(...),Caltrain.next_trip(...), andCaltrain.fare_between(...)functions all perform sanitization
themselves and can automatically resolve alternate common names for
stations.For example,sf,sanfrancisco,san fran,san francisco stationare all understood as the same station. Same
with22nd,Twenty-Second,twenty second street, and22nd str.
Package: python-can
TheControllerAreaNetwork is a bus standard designed
to allow microcontrollers and devices to communicate with each other. It
has priority based bus arbitration and reliable deterministic
communication. It is used in cars, trucks, boats, wheelchairs and more.Thecanpackage provides controller area network support for
Python developers; providing common abstractions to
different hardware devices, and a suite of utilities for sending and receiving
messages on a can bus.The library currently supports CPython as well as PyPy and runs on Mac, Linux and Windows.Library VersionPython2.x2.6+, 3.4+3.x2.7+, 3.5+4.0+3.7+4.3+3.8+Featurescommon abstractions for CAN communicationsupport for many different backends (see thedocs)receiving, sending, and periodically sending messagesnormal and extended arbitration IDsCAN FDsupportmany different loggers and readers supporting playback: ASC (CANalyzer format), BLF (Binary Logging Format by Vector), MF4 (Measurement Data Format v4 by ASAM), TRC, CSV, SQLite, and Canutils logefficient in-kernel or in-hardware filtering of messages on supported interfacesbus configuration reading from a file or from environment variablescommand line tools for working with CAN buses (see thedocs)moreExample usagepip installpython-can# import the libraryimportcan# create a bus instance using 'with' statement,# this will cause bus.shutdown() to be called on the block exit;# many other interfaces are supported as well (see documentation)withcan.Bus(interface='socketcan',channel='vcan0',receive_own_messages=True)asbus:# send a messagemessage=can.Message(arbitration_id=123,is_extended_id=True,data=[0x11,0x22,0x33])bus.send(message,timeout=0.2)# iterate over received messagesformsginbus:print(f"{msg.arbitration_id:X}:{msg.data}")# or use an asynchronous notifiernotifier=can.Notifier(bus,[can.Logger("recorded.log"),can.Printer()])You can find more information in the documentation, online atpython-can.readthedocs.org.DiscussionIf you run into bugs, you can file them in ourissue trackeron GitHub.Stackoverflowhas several
questions and answers tagged withpython+can.Wherever we interact, we strive to follow thePython Community Code of Conduct.ContributingSeedoc/development.rstfor getting started.
Package: python-can-bluetooth
This module is a plugin for thepython-can. module, that allows the use of CAN messages transmitted over a Bluetooth SPP connection. It is similar to the CAN over serial protocol included in thepython-can. package, but includes additional error checking to ensure messages are not corrupted during transmission.InstallationInstall using pip:$ pip install python-can-bluetoothUsageIn general, useage is largely the same as with the mainpython-canlibrary, using the interface designation of “bluetooth”.Create python-can bus with the Bluetooth interface:importcanbus=can.Bus(interface="bluetooth",channel="COM4",bitrate=250000,echo=False)Some examples are present in the python-can-bluetooth/examplesdirectory in the repository.
Package: python-can-canine
python-can-canineThis module is a plugin that lets you useCANine adapterswith theCANine firmwarein python-can.InstallationInstall using pip:$ pip install python-can-canineUsageOverall, using this plugin is quite similar to the main Python-CAN library, with the interface namedcanine. To integrate the Canine interface into your scripts, you can import constants, device designations, and more from the Python-CAN-Canine module usingimport canine. For most scenarios, incorporating a Canine interface is as easy as modifying Python-CAN examples with the lines provided below:Create python-can bus with the Canine USB interface:import can
from canine import CANineBus

bus = can.Bus(interface="canine", bitrate=1000000)
Package: python-can-cvector
python-can-cvectorTable of ContentsDescriptionInstallationUsageTestBuildLicenseDescriptionThis package provides a Cython based version of thepython-canVectorBus.can_cvector.CVectorBusis a subclass ofcan.interfaces.vector.VectorBuswhich reimplements thesend()andrecv()methods for improved performance.Installationpip install python-can-cvectorUsageThe class can be used either through the python-can APIfromcanimportBusbus=Bus(interface="cvector",serial=100,channel=0)or instantiated directlyfromcan_cvectorimportCVectorBusbus=CVectorBus(serial=100,channel=0)Read thepython-can documentationto learn more.Testpip install pytestpytest ./testsBuildTo buildpython-can-cvectorfrom source you need to set the environment
variableVXLAPI_DIRwhich points to the directory which Vector XL Driver Library
(e.g. C:\Users\Public\Documents\Vector\XL Driver Library 20.30.14\bin).pip install buildpython -m build .Licensepython-can-cvectoris distributed under the terms of theLGPL-3.0-or-laterlicense.
Package: python-can-mcpcan
python-can-mcpcanThis module is a plugin that lets you use [MCPcan adapters](available only from d10automation) with theMCPcan firmwarein python-can.InstallationInstall using pip:$ pip install python-can-mcpcanUsageOverall, using this plugin is quite similar to the main Python-CAN library, with the interface namedmcpcan. For most scenarios, incorporating a MCPcan interface is as easy as modifying Python-can examples with the lines provided below:Create python-can bus with the mcpcan serial interface:import can

bus = can.Bus(interface="mcpcan", channel="COM2", fd=True, bitrate=500000, data_bitrate=2000000)
Package: python-can-remote
Creates a CAN over TCP/IP bridge for use withpython-can.InstallationInstall using pip:$ pip install python-can-remoteUsageStart server from command line:$ python -m can_remote --interface=virtual --channel=0 --bitrate=500000Create python-can bus:importcan# Create a connection to server. Any config is passed to server.bus=can.Bus('ws://localhost:54701/',bustype='remote',bitrate=500000,receive_own_messages=True)# Send messagesmsg=can.Message(arbitration_id=0x12345,data=[1,2,3,4,5,6,7,8])bus.send(msg)# Receive messagesmsg2=bus.recv(1)print(msg2)# Disconnectbus.shutdown()Web interfaceThere is also a basic web interface for inspecting the CAN traffic
using a browser.
It is available on the same address using HTTP, e.g.http://localhost:54701/.
Package: python-can-sontheim
This module is a plugin for thepython-can. module, that allows the use of CAN interfaces that rely on the Sontheim Industrie Elektronik (SIE) MTAPI drivers (windows only). These include the SIE CANfox (including rebranded versions such as that by IFM), SIE CANUSB, etc.InstallationInstall using pip:$ pip install python-can-sontheimUsageIn general, useage is largely the same as with the mainpython-canlibrary, using the interface designation of “sontheim”. When integrating the sontheim interface into scripts, it is possible to import constants, device deisgnations etc from the python-can-sontheim module using “import can_sontheim”. For the majority of the use cases, using an SIE interface is as simple as amending any python-can examples with the lines shown below:Create python-can bus with the SIE CANfox USB interface:importcanfromcan_sontheimimportdevicesbus=can.Bus(interface="sontheim",channel=devices.CANfox.CAN1,bitrate=250000,echo=False)Some examples are present in the python-can-sontheim/examplesdirectory in the repository, and more complete documentation specific to the SIE interfaces and driver will be uploaded to this module in due course.
Package: python-cant-stop
Can't Stop strategy helperUsing the algorithm fromSolitaire Laboratory,cant-stoptells you if you should stop or continue your current turn of the dice gameCan't Stop.Usagecant-stoptakes a list of strings of the format<roll>x<count>where<roll>is the roll column
and<count>is the number of tokens placed there this turn so far. For example, if you rolled a 1,
1, 2, and 3, and chose columns 2 and 5:~$cant-stop2x15x1
INFO:cant_stop.cli:Yourscoreis18and if you next rolled a 1, 1, 6, and 6:~$cant-stop2x25x112x1
INFO:cant_stop.cli:Yourscoreis36Time to stop!Installationcant-stopis available onPyPI:~$pipinstallpython-cant-stop
...
~$cant-stop-hInstallation from sourceThis assumes you havegit,Python 3.9+, andpoetryinstalled
already.~$gitclonegit@gitlab.com:henxing/cant_stop.git
~$cdcant_stop
cant_stop$poetryinstall
...
cant_stop$poetryrunwordle-helper-h
Package: python-canvas
python-canvasБиблиотекаpython-canvasявляется SqlAlchemy-маппингом для базы данных Canvas LMS.Примерыfromcanvas_db.configimportConfigfromcanvas_db.ormimportget_sessionconfig=Config(host='Адрес БД Canvas LMS',user='Пользователь БД Canvas LMS',passowrd='Пароль БД Canvas LMS')session=get_session(config)
Package: python-cardano
Python implementation of Cardano project, including network protocol, crypto primitives, wallet logic, and more.Why This ProjectWe want to explore alternate design decisions to support lightweight wallet, and start developing the mobile wallet for Cardano. Current official wallet node is not enough yet.Explore the design space of clustered wallet node.Provide alternative implementation of Cardano protocols and specifications in another programming language.In the future, it could be an alternative foundation for projects in Cardano ecosystem: wallets, side-chains, MPCs.Why PythonPython is still one of the most cleanly designed, developer friendly programming language out there, has a reputation of
executable pseudocode. And lightweight thread provided by gevent makes it suitable to write networking software, and easy
interoperability with C thanks to Cython enables us to improve performance incrementally.With python, we can develop clean prototype very fast, with good performance. And in the future we can always move the CPU intensive code to C
after we indentified the hotspot.Build & Test$virtualenv-ppython3.env$source.env/bin/activate$pipinstall-rrequirements.txt$pythonsetup.pybuild_ext--inplace$mkdir./test_db$pythonscripts/pycardano.pyrunsyncblockdatafrommainnetandsubscribingfornewblocksautomatically.$pythonscripts/pycardano.pywalletcreatedefaultgeneratewalletFeaturesStore block data of different epochs in seperate rocksdb database, provides better disk usage(fully synchronized mainchain takes 1.3G disk space), and allows faster synchronization in the future.pycardano.py signsign a message with wallet, prove an wallet address belongs to you.pycardano.py verifyverify a signed message.pycardano.py utxo statSome statistics of global UTxOs.Modulescardano.addressImplement Cardano HD address derivation and encoding, and wallet recovering for lagacy address format.cardano.transportImplement Haskell’s network-transport-tcp, multiplex multiple lightweight unidirectional connections on a single tcp connection.cardano.nodeImplement cardano-sl’sNode, allow bidirectional conversation between endpoints.cardano.storageStorage api of block and wallet’s data.cardano.blockBlock data structures.cardano.logicWorkers and listeners of default node.cardano.retrieveRetrieve block data with cardano-sl mainnet.cardano.walletImplement wallet logic according to formal specification.TODOswallet state storage, a simple solution first, hopefully something like Haskell’s acid-state in the end.block verification.relay block data with stream api.wallet cli app.wallet V1 api and api for SPV light client.clustered wallet storage.
Package: python-card-framework
Python Card FrameworkThis is a library designed to allow Python developers to treat the Chat API
JSON to be generated for cards and dialogs as objects, each capable of
rendering themselves into valid JSON instead of hand-crafting or cut-and-pasting
JSON in large blocks.The exact JSON that is being rendered can be found in the official Google
Developer Docs pages here:https://developers.google.com/chat/api/reference/rest/v1/spaces.messages?hl=enIntentionIn order to generate or send messages from a chat application to the user, the
messages must be formed of valid JSON objects. In the event that the message is
malformed, a simple 'Chat App not responding' message is returned. This leads
to the developer having to insert large blocks of JSON in their Python code,
much of which is boiler-plate and can easily lead to hard to find cut and paste
errors.As a result this library of objects has been created to alleviate the problem.
The developer can now create and manipulate first-class Python objects which
know how to correctly render themselves. Thus, instead of inserting this:return {
    "sections": [
        {
          "widgets": [
            {
              "decoratedText": {
                "topLabel": "Hello, my name is Inigo Montoya",
                "text": "You killed my father. Prepare to die.",
                "startIcon": {
                  "knownIcon": "PERSON"
                }
              }
            }
        ]
      }
    ],
    "header": {
      "title": "The Princess Bride",
      "imageUrl": "https://source.unsplash.com/featured/320x180?nature&sig=8",
      "imageType": "CIRCLE"
    }
  }... the developer can instead do this (with the appropriateimports, of course):text = DecoratedText(top_label='Hello, my name is Inigo Montoya',
                     text='You killed my father. Prepare to die.',
                     start_icon=Icon(known_icon=Icon.KnownIcon.PERSON))
widgets = [text]
header = CardHeader(title='The Princess Bride',
                    image_url='https://source.unsplash.com/featured320x180?nature&sig=8')
card = Card(header=header, sections=[Section(widgets=widgets)])

return Message(cards=[card]).render()which will return the correct JSON.