Saravanan666/pypi-org huggingface dataset:
Package: pyfritzhome
Tested DevicesFRITZ!Box 6490 CableFRITZ!DECT 200FRITZ!DECT 440FRITZ!DECT 500Comet DECTPanasonic KX-HNS101Magenta Smarthome Tür-/Fensterkontakt optischRADEMACHER RolloTron DECT 1213Magenta Smarthome Zwischenstecker außenMagenta SmartHome LED-Lampe E27 WarmweißMagenta SmartHome Zwischenstecker innenMagenta Smarthome Tür-/Fensterkontakt magnetischfritzhome CLI toolYou have to add a user with the rights to access the smarthome actors.In the fritzbox webinterface under “System -> FRITZ!Box-Benutzer” you can
add a new user.$fritzhome-ffritz.box-usmarthome-psmarthomelist##############################name=FensterBadezimmerain=119340154799-1id=2000productname=HAN-FUNmanufacturer=0x0febpresent=Truelock=Nonedevicelock=Noneis_group=FalseAlert:alert=True##############################name=ThermostatBadezimmerain=119590171328id=16productname=CometDECTmanufacturer=AVMpresent=Truelock=Falsedevicelock=Falseis_group=FalseTemperature:temperature=19offset=-3Thermostat:battery_low=Falsebattery_level=80actual=19.0target=19.0comfort=22.0eco=19.0window=Falsesummer=Falseholiday=False##############################name=WohnzimmerCouchain=099950523646id=17productname=FRITZ!DECT301manufacturer=AVMpresent=Truelock=Falsedevicelock=Falseis_group=FalseTemperature:temperature=20.5Thermostat:battery_low=Falsebattery_level=80actual=20.5target=21.5comfort=21.5eco=17.5window=Falsesummer=Falseholiday=False##############################name=WohnzimmerTischain=099950517495id=18productname=FRITZ!DECT301manufacturer=AVMpresent=Truelock=Falsedevicelock=Falseis_group=FalseTemperature:temperature=21.0Thermostat:battery_low=Falsebattery_level=80actual=21.0target=21.5comfort=21.5eco=17.5window=Falsesummer=Falseholiday=False##############################name=SchalterWCHeizungain=087610402392id=21productname=FRITZ!DECT200manufacturer=AVMpresent=Truelock=Truedevicelock=Falseis_group=FalseSwitch:switch_state=FalsePowermeter:power=0energy=436529voltage=231.0Temperature:temperature=22offset=3##############################name=Wohnzimmerain=grp303E4F-3F7D9BE07id=900productname=manufacturer=AVMpresent=Truelock=Falsedevicelock=Falseis_group=Truegroup_members=['17','18']Thermostat:battery_low=Nonebattery_level=Noneactual=Nonetarget=21.5comfort=21.5eco=17.5window=Nonesummer=Noneholiday=NoneFritzbox UserAdd a new user: System -> FRITZ!Box-BenutzerReferenceshttps://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/AHA-HTTP-Interface.pdfhttps://github.com/DerMitch/fritzbox-smarthome
Package: pyfrobot
Py Framework RobotFichero de configuraciónmqtt:enabled:true# Parametros de conexión a mqttconnection:broker_host:"localhost"broker_port:1883client_id:"test"username:"robot"# Change to None if not requiredpassword:"robot"# Change to None if not required# Alias de los topics y subscripcionestopics:aliases:-"topic:alias"subscribe:-alias1
Package: py-front
# py-frontA python API wrapper around [Front](https://frontapp.com).# Installation```bashpip install py-front```# Usage## Set api key```pythonimport frontfront.set_api_key("jwt_token")```## Use the api```pythonimport frontfor conv in front.Conversation.objects.all():print(conv.id, conv.subject)```# Available models- Contact- https://dev.frontapp.com/#contacts- Tag- https://dev.frontapp.com/#tags- Channel- https://dev.frontapp.com/#channels- Conversation- https://dev.frontapp.com/#conversations- Inbox- https://dev.frontapp.com/#inboxes- Teammate- https://dev.frontapp.com/#teammates- _More soon..._ PRs are welcome!
Package: py-frontmatter
py-frontmatterTo manipulate front matter in document file.Installationpipinstallpy-frontmatterUsageGiven text file:---
title: Hacker's notetags: [a, b]---# headertextGet or set whole section of front matterTo retrieve front matter as JSON:% frontmatter get note.md | jq
{
  "title": "Hacker's note",
  "tags": [
    "a",
    "b"
  ]
}To replace the front matter:% echo '{"title": "My note", "tags": ["a", "b", "c"]}' | frontmatter set note.md
% cat note.md
---
title: My note
tags:
- a
- b
- c
---
# header
textAdd or remove item from front matter% frontmatter add-item --jsonpath '$.tags' --item d note.md
% cat note.md
---
title: My note
tags:
- a
- b
- c
- d
---
# header
text
%
% frontmatter remove-item --jsonpath '$.tags' --item d note.md
% cat note.md
---
title: My note
tags:
- a
- b
- c
---
# header
textSpecialize commands to add/remove tag% frontmatter add-tag --tag d note.md
% cat note.md
---
title: My note
tags:
- a
- b
- c
- d
---
# header
text
% frontmatter remove-tag --tag d note.md
% cat note.md
---
title: My note
tags:
- a
- b
- c
---
# header
text
Package: pyfrozen
pyfrozenSet of collections with ability to freeze their items.Installation$ pip install pyfrozenUsage>>> from pyfrozen import FrozenDict, FrozenList
>>>
>>> fd = FrozenDict()
>>> fd['key_1'] = 'value_1'
>>> fd
<FrozenDict(frozen=False, {'key_1': 'value_1'})>
>>> fd.freeze()
>>> fd
<FrozenDict(frozen=True, {'key_1': 'value_1'})>
>>> fd['key_1'] = 'value_2'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/pyfrozen/pyfrozen/frozendict.py", line 23, in __setitem__
    self.assert_frozen()
File "/pyfrozen/pyfrozen/frozendict.py", line 45, in assert_frozen
    raise RuntimeError('Cannot modify frozen dict')
RuntimeError: Cannot modify frozen dict
>>> fd
<FrozenDict(frozen=True, {'key_1': 'value_1'})>
>>>
>>> fl = FrozenList()
>>> fl.extend(['value_1', 'value_2'])
>>> fl
<FrozenList(frozen=False, ['value_1', 'value_2'])>
>>> fl.freeze()
>>> fl.pop()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/lib/python3.6/_collections_abc.py", line 997, in pop
    del self[index]
File "/pyfrozen/pyfrozen/frozenlist.py", line 29, in __delitem__
    self.assert_frozen()
File "/pyfrozen/pyfrozen/frozenlist.py", line 56, in assert_frozen
    raise RuntimeError('Cannot modify frozen list')
RuntimeError: Cannot modify frozen list
>>> fl
<FrozenList(frozen=True, ['value_1', 'value_2'])>
>>>ContributingTo work on thepyfrozencodebase, you'll want to clone the project locally and install the required dependencies viapoetry:$ git clone git@github.com:Gr1N/pyfrozen.git
$ poetry installTo run tests and linters use command below:$ poetry run toxIf you want to run only tests or linters you can explicitly specify which test environment you want to run, e.g.:$ poetry run tox -e py37-testsTODOImplement all collections usingCythonLicensepyfrozenis licensed under the MIT license. See the license file for details.
Package: pyfsa
PyFSAA python CLI to render finite state graphs.This application takes a CSV file with state information, and uses it to either produce the finite state graph, and verify that strings are valid given the state information, a start state, and a desired state. Thestringsubcommand is also able to render the traversal graph of a string through the state machine.InstallationYou can install this project directly from github withpip, but it is also available inpypi. Install it like so:python3-mpipinstallpyfsaGraphViz is required to run this, as graphviz is the rendering engine used to create the png files. You can find lots of information on how to do that here:https://graphviz.org/download/On Ubuntu, you can find it in your package manager or install it directly using APT:$aptinstallgraphvizYou might need to also install the graphviz development library to ensure the Python wrapperpygraphvizruns properly. You can find more information on installingpygraphvizon theirwebsite. On Ubuntu, you can install it with the following command:$aptinstalllibgraphviz-devExamplesState file:trigger,source,target
a,x,y
b,x,z
a,y,x
b,y,z
a,z,z
b,z,zfsastate-fexamples/states.csvfsastate-fexamples/states.csv-sxfsastate-fexamples/states.csv-ezfsastate-fexamples/states.csv-sx-ez
Package: pyfs-application
Feishu Application Module for Python.Installationpip install pyfs-applicationUsagefrom pyfs_application import Application, is_user_adminMethodclass MarketCode(BaseToken):
    def __init__(self, appid=None, secret=None, token=None, storage=None):
        super(MarketCode, self).__init__(appid=appid, secret=secret, token=token, storage=storage)

    def is_user_admin(self, open_id=None, employee_id=None, appid=None, secret=None, ticket=None, token=None, storage=None):
Package: pyfs-base
Feishu Base Class for Python.Installationpip install pyfs_baseUsageIn [1]: from pyfs_base import BaseFeishu

In [7]: class XXX(BaseFeishu):
   ...:     pass
   ...:

In [3]: xxx = XXX()

In [4]: xxx.OPEN_DOMAIN
Out[4]: 'https://open.feishu.cn'

In [6]: xxx._requests
Out[6]: <bound method XXX._requests of <__main__.XXX object at 0x7f9248260d10>>

In [7]:
Package: pyfscache
A simple filesystem cache for python.Home Page, Documentation, & RepositoryHome Page:http://pyfscache.bravais.netOnline Documentation:http://pythonhosted.org/pyfscache/Code Repository:https://github.com/jcstroud/pyfscache/IntroductionPyfscache (python filesystem cache) is a filesystem cache
that is easy to use. The principal class isFSCache,
instances of which may be used as decorators to create cached
functions with very little coding overhead:importpyfscachecache_it=pyfscache.FSCache('some/cache/directory',days=13,hours=4,minutes=2.5)@cache_itdefcached_doit(a,b,c):return[a,b,c]It’s that simple!Now, every time the functioncached_doitis called with a
particular set of arguments, the cachecache_itis inspected
to see if an identical call has been made before. If it has, then
the return value is retrieved from thecache_itcache. If not,
the return value is calculated withcached_doit, stored in
the cache, and then returned.ExpirationIn the code above, the expiration forcache_itis set to
1,137,750 seconds (13 days, 4 hours, and 2.5 minutes),
which means that every item created bycache_ithas a lifetime
of 1,137,750 seconds, beginning when the item is made (notbeginning whencache_itis made). Values specifying lifetime
may be provided with the keywordsyears,months,weeks,days,hours,minutes, andseconds. The lifetime is
the total for all keywords.If these optional keyword arguments are not included, then items
added by theFSCacheobject never expire:no_expiry_cache=pyfscache.FSCache('some/cache/directory')NoteSeveral instances ofFSCacheobjects
can use the same cache directory. Each will honor
the expirations of the items therein. Thus, it is possible
to have a cache mixed with objects of many differening
lifetimes, made by many instances ofFSCache.Works Like a MapInstances ofFSCachework like mapping objects, supporting
item getting and setting:>>>cache_it[('some',['key'])]={'some':'value'}>>>cache_it[('some',['key'])]{'some':'value}However, deletion with thedelstatement only works on memory.
To erase an item in the cache directory, useexpire:>>>cache_it.get_loaded()['LIlWpBZL68MBJaXouRjFBL3fzScyxh5q56hqSZ3DBK']>>>delcache_it[('some',['key'])]>>>cache_it.get_loaded()[]>>>('some',['key'])incache_itTrue>>>cache_it[('some',['key'])]{'some':'value}>>>cache_it.expire(('some',['key']))>>>('some',['key'])incache_itFalseDecoratorsWhat if you didn’t write the function you want to cache?
Although their convenience is manifest in the example above,
it is not necessary to use decorators:importpyfscachecache=pyfscache.FSCache('some/cache/directory',days=13,hours=4,minutes=2.5)defuncached_doit(a,b,c):return[a,b,c]cached_doit=cache(uncached_doit)VersatilityFSCacheobjects should work on the vast majority of python
“callables”, including instance methods and even built-ins:# a cached built-incached_list=cache_it(list)# a cached instance methodclassAClass(object):@cahe_itdefsome_cached_instance_method(self,a,r,g,s):return(a+r)/(g*s)NoteThe rule of thumb is that if python’scPicklemodule
can handle the expected arguments to the cached function,
then so can pyfscache.
Package: pyfse
This project consists in helper classes used to design FSM (Finite State Machines) from pure python classes.Example usage is included in /tests. Additional documentation can be found indoc.Changelog0.1.1Added integration withMsgLoggerfrom pyjld.logger package0.1.0Added support for positional & keyword arguments0.0.6Modifiedaction_methodto increase separation of concern0.0.5Added support for moreaction_method0.0.4Backward compatibility breakageAddedaction_methodsupport totransition table0.0.3Added the ‘attractor’ transition0.0.2Removed unnecessary imports0.0.1Initial alpha release
Package: pyfseconomy
Python FSEconomy Interface LibraryThis package provides a python interface to the FSEconomy datafeeds. Your own personal data key can be retrieved from
theFSEconomy data feeds page.It provides access to the following data:Retrieval of assignments for a list of ICAOs - can be filtered by size/pax/trip type.Get a list of planes by type - can be filtered by hours since 100hr service/rentableGet a list of planes owned by a specific user by their usernameTo avoid too many calls to the data feed the library will cache the plane data internally. This cache can be requested
to update if required.ExamplesJob FinderThis script will search for the highest paying jobs both in terms of v$ per nautical miles and overall value for a
selected aircraft - filtered based on maximum distance and overall distance.Usage example:python examples/job_finder.py --access-key=<personal FSE data feed key>
Package: pyfsevents
ContentsIntroductionInstallationLicenseRequirementsLimitationsModule Documentationcallback signaturesIntroductionpyfsevents is a C extension providing a Python interface for Mac OS X 10.5 and
later which allows monitoring for file system events, using FSEvents.pyfsevents uses a callback mechanism: seeModule Documentation.Installationpython setup.py installLicenseDistributed under the terms of the MIT License.RequirementsMac OS X >= 10.5 LeopardLimitationsThread-unsafe: CFRunLoop’s and Python threads do not quite interact well
when put together :)Module Documentationpyfsevents uses a callback mechanism.It provides two functions:registerfd(fd, callback[, mask])registerpath(path, callback)to register objects to monitor.After registration,listen()should be called to wait for events.
The call is blocking: callbacks are fired on events.stop()is available to stop thelisten()call.stop()should be called
from a different thread.Please seeexamples/for use cases of the extension.callback signaturesThecallbackarguments passed toregister*functions will be fired on
events. These callback functions should be functions callable with two
arguments, aslistenwill call these functions with two arguments:For File descriptors,registerfdcallbacks will be passed (fd, mask) arguments:fdfile descriptor which changed and fired the callback.maskthe POLLIN / POLLOUT mask, similar to theselect.pollmodule.For FSEvents,registerpathcallbacks will be passed (path, recursive) arguments:paththe path where the event occurred.recursivea boolean: if True, the caller should check recursively the directory tree for changes, and not only the specified directory.
Package: pyfsftpserver
pyfsftpserverA simple FTP server for serving PyFilesystem2 filesystems.Serve the current directory on your local filesystem over FTP:pip install pyfsftpserver
python -m pyfsftpserverServe an AWS S3 or Google GCS bucket:pip install pyfsftpserver gcsfs
python -m pyfsftpserver gcs://bucket_name/HighlightsCan be backed withPyFilesystem2filesystemsDoes not use OS specific calls, so no fork or setuid is usedDoes not support authenticationMade for educational purposesNot optimized for speed or memory usageOptimized for extensibilityRequirementsPython >= 3.6NotesI had problems with gcsfs, so included a patched version in this repository. It
can be accessed viapython -m pyfsftpserver gcs-patched://bucket_name/urls.Sourceshttps://github.com/sorgloomer/pyfsftpserverChangeloghttps://github.com/sorgloomer/pyfsftpserver/blob/master/CHANGELOG.mdTODOsRelease to PyPIImplement IPv6 extensions by rfc2428Implement more extensions from rfc3659 like mdmt etc...LicenseMIT
Package: pyfsig
pyfsigA python library for identifying files by headers (magic bytes).
You may notice that on MS windows systems files will not open properly if you
change the file extension, this is becuase MS windows only pays attention to
the file header.
Magic bytes/file headers serve as a way to discover the type of file without
using the file extension.
This library was written to assist python programmers in identifying what type
of file something is from its magic bytes/file header.
It was originally written by the author to reconstruct BLOB's from a legacy
database which did not store the original file extensions.based on info from:'Wikipedia - List of file signatures'UsageThe libraries use should fairly self explainatory, here are some examples:Find matches for a file when you have the file pathfile_path="some/file/path.abc"matches=find_matches_for_file_path(file_path=file_path)Find matches for a file header you have read yourself[!IMPORTANT]
The "rb" here is very important, you must read the file as "bytes"!withopen(file_path,"rb")asf:file_header=f.read(32)matches=find_matches_for_file_header(header=file_header)Find matches against your own list of file signaturesYou will need to create aFileSignatureDictwith atleast the following keys:file_extensionhexoffsetcustom_signatures=[{"file_extension":"abc","hex":[1,2,3,None,5],"offset":0,}]file_path="some/file/path.abc"matches=find_matches_for_file_path(file_path=file_path,signatures=custom_signatures)Alternatively, you can extend the built in file signatures with your custom
file signatures.frompyfsigimportSIGNATURESextended_signatures=[*SIGNATURES,{"file_extension":"abc","hex":[1,2,3,None,5],"offset":0,}]file_path="some/file/path.abc"matches=find_matches_for_file_path(file_path=file_path,signatures=extended_signatures)ContributorsAuthor: Patty C (schlerp)Thanks to all contributors!!
Package: pyfsm-tool
pyfsm-toolpyfsm-tool is a module to create and manipulate finite states machines (fsm).Getting startedImport modulesFiniteStateMachine module:frompyfsm_toolimportFiniteStateMachine,StateBehaviourExceptions module:frompyfsm_toolimportFSMExceptionCreate new FSMThe new fsm is empty (No state and no transition).fsm:FiniteStateMachine=FiniteStateMachine()Initialize the fsm data storeInitialize fsm data store wit 'message' and 'count' available for all states.fsm.fsm_data_store={"message":"","count":0}Create new behavioursCreate new behaviours for fsm states.First behaviour: add 'Hello' in fsm data store (key = 'message') and next transition is 't1'classBehaviour1(StateBehaviour):defaction(self)->None:self.state_data_store["message"]+="Hello"defnext_transition_id(self)->str:return"t1"Second behaviour: add ' ' in fsm data store (key = 'message') and next transition is 't2'classBehaviour2(StateBehaviour):defaction(self)->None:self.state_data_store["message"]+=" "defnext_transition_id(self)->str:return"t2"Third behaviour: add 'world' in fsm data store (key = 'message') and next transition is 't3'classBehaviour3(StateBehaviour):defaction(self)->None:self.state_data_store["message"]+="world"defnext_transition_id(self)->str:return"t3"Fourth behaviour: add '!' in fsm data store (key = 'message') and next transition is 't4' (itself) if the key 'count' in fsm data store is less than 2 (there is incrementation of fsm data store for key 'count'), else next transition is 't5'classBehaviour4(StateBehaviour):defaction(self)->None:self.state_data_store["message"]+="!"defnext_transition_id(self)->str:ifself.state_data_store.get("count")<2:self.state_data_store["count"]+=1return"t4"return"t5"Fifth behaviour: display fsm data store (key = 'message') and finish fsm.classBehaviour5(StateBehaviour):defaction(self)->None:print(self.state_data_store.get("message"))Register all statesRegister first state with first behaviourfsm.register_first_state(Behaviour1(),"b1")Register next states with next behavioursfsm.register_state(Behaviour2(),"b2")fsm.register_state(Behaviour3(),"b3")fsm.register_state(Behaviour4(),"b4")Register last state with last behaviourfsm.register_last_state(Behaviour5(),"b5")If state behaviour not inheritsStateBehaviourclass or if state already
exists(same id) or if an argument isNone, thenFSMExceptionis raise.try:fsm.register_state(Behaviour2(),"b2")exceptFSMExceptionaserror:pass# or do something...Register all transitionsfsm.register_transition("b1","b2","t1")fsm.register_transition("b2","b3","t2")fsm.register_transition("b3","b4","t3")fsm.register_transition("b4","b4","t4")fsm.register_transition("b4","b5","t5")If transition already exists(same id) or if an argument isNone, thenFSMExceptionis raise.try:fsm.register_transition("b1","b2","t1")exceptFSMExceptionaserror:pass# or do something...Run FSMfsm.run()AuthorIf you have any questions or suggestions, please don't hesitate to contact me :belaich.david@outlook.fr.
Package: py-fso
The main function of this small package is to process the contents of a
folder with a single function:folder.process()(pun intended
:-), without going into the details of iterating over files and folders.It’s strange that python doesn’t have such a built-in function, but
maybe someone (maybe even myself) will write an extension tocsomeday.So, if, for example, you need to find all files with a too long full
name, you just need to write the following script:from argparse import ArgumentParser
from py_fso import folder

MAX_FILEPATH_LENGTH = 260

def print_if_file_has_length_too_more_chars(fileEntry) :
    filePath = fileEntry.path
    fileLength = len(filePath)
    if fileLength > MAX_FILEPATH_LENGTH:
        print("File " + filePath + " has  length " + str(fileLength) + " chars")

parser = ArgumentParser(description='Scan a directory and its subdirectories and search for files with path lengths greater than ' + str(MAX_FILEPATH_LENGTH) + ' characters.')
parser.add_argument("directory", help="scan this directory with its subdirectories", metavar="DIR")
parser.add_argument("-m", "--max_filepath_length", help="max file path's length")
args = parser.parse_args()
if args.max_filepath_length:
    MAX_FILEPATH_LENGTH = int(args.max_filepath_length)

folder.process(init_dir = args.directory, proc_file_function = print_if_file_has_length_too_more_chars, process_dirs = False, proc_dir_function = '', go_into_subdirs = True)Just one call to folder.process() will replace all the details of traversing the contents of the folder, allowing you to focus on the main action of the script.The package also includes several useful functions for working with text files.I use this package all the time in my work, installing it globally so that it’s available to all scripts. It’s very convenient.Getting StartedPrerequisitespython(version >=3+, version 2+ doesn’t
check)Installing# Just install the package globally (recommended)
# so you can use in all your scripts and projects:
$ python -m pip install py_fsoUsing# then you can use it in your scripts
from py_fso import folder
from py_fso import textfileOne more script example#!/usr/bin/python
# -*- coding: utf-8 -*-
""" Try to find  all files in the folder of a site including sub-folders which are not UTF-8 encoded."""

import chardet
import os.path
from py_fso import folder

fileListExtensions = ["htm", "html", "php", "css", "js"]

def print_if_file_code_page_not_utf8(fileEntry) :
    filePath = fileEntry.path
    if os.path.splitext(filePath)[1][1:].strip().lower() in fileListExtensions:
        with open(filePath, "rb") as F:
            text = F.read()
            enc = chardet.detect(text).get("encoding")
            if enc and enc.lower() != "utf-8":
                print("File " + filePath + " might not be UTF-8 encoded")

folder.process("path\\to\\your\\site\\folder", proc_file_function = print_if_file_code_page_not_utf8, process_dirs = False, proc_dir_function = None, go_into_subdirs = True)VersioningUsingSemVerfor versioning.AuthorsMikhail Trusov-py_fsoLicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for details
Package: pyfs-pay
Feishu Pay Module for Python.Installationpip install pyfs-payUsagefrom pyfs_pay import Pay, check_user_paid_scopeMethodclass Pay(TenantAccessToken):
    def __init__(self, appid=None, secret=None, ticket=None, tenant_key=None, token=None, storage=None):
        super(Pay, self).__init__(appid=appid, secret=secret, ticket=ticket, tenant_key=tenant_key, token=token, storage=storage)

    def check_user_paid_scope(self, open_id=None, user_id=None, appid=None, secret=None, ticket=None, tenant_key=None, token=None, storage=None):