Saravanan666/pypi-org huggingface dataset:
Package: python-shorturl
===============Python-ShortUrl 0.0.4===============A python library to shorten urls using one of three url shortening servicesSupports the following services:-tinyurl.com-bit.ly, j.mp, bitly.com (must use login and apikey)-is.gdInstallation============To install Python-ShortUrl:pip install python-shorturlAlternatively:wget https://github.com/appscluster/python-shorturl/archive/master.zip7z x master.zip ( if you don't have 7z : sudo apt-get install p7zip-full )cd python-shorturl-master/python setup.py installUsage=====Command line:Usage: shorturlpy.py [-u] [-d] [-l] [-a]Options:-u  --url        Full URL http://www.google.co.uk-d  --default    Any, tinyurl, is.gd, bitly-l  --login      bitly Login-a  --apikey     bitly apikeyExamples:default:python -m shorturlpy.shorturlpy -u http://www.appscluster.comtinyurl:python -m shorturlpy.shorturlpy -u http://www.appscluster.com -d tinyurlis.gd:python -m shorturlpy.shorturlpy -u http://www.appscluster.com -d is.gdbitly:python -m shorturlpy.shorturlpy -u http://www.domain.co -d bitly -l xyz_login -a zyx_keyNote: replace xyz_login and zyx_key with your own bitly account detailsWithin your application:import shorturlpyloadurl = shorturlpy.ShortUrlPy()print loadurl.ShortenUrl('http://www.appscluster.com')print loadurl.ShortenUrl('http://www.appscluster.com', 'tinyurl')print loadurl.ShortenUrl('http://www.appscluster.com', 'is.gd')print loadurl.ShortenUrl('http://www.appscluster.com', 'bitly', 'xyz_login', 'zyx_key')Note: replace xyz_login and zyx_key with your own bitly account detailsTested on Python 2.7Developed by Abdul Hamid https://twitter.com/AbdulHamidCEO
Package: python-shout
python-shoutpython-shout is a fork of the original shout-python, a set of bindings for libshout 2.python-shout allows you to act as a source for icecast 1 and 2, and
shoutcast. This module includes inline documentation, or see
the included example.py for a demonstration of its usage.CompatibiltyThis version supports both Python 2 and Python 3For libshout <= 2.2.2, use python-shout==0.2.5InstallationYou need to have Python and libshout 2 development packages installed.For example on Debian:sudo apt-get install python3-dev python3-pip libshout3-devIf you have pkg-config installed, make sure it can find shout
(you may need to adjust PKG_CONFIG_PATH to contain
$shout_prefix/lib/pkgcofig). Otherwise, shout-config must
appear in your path.Then install through pip:sudo pip3 install python-shoutor though the git repository:git clone https://github.com/yomguy/python-shout.git
python3 setup.py installLicensepython-shout is licensed under the GNU LGPL. See COPYING for details.
Package: python-shout3
This is a Python 3 version of the [python-shout](https://pypi.org/project/python-shout/) project.This package was created by [yomguy](https://github.com/yomguy/), check out the original source [here](https://github.com/yomguy/python-shout)._Please note: you must installlibshout3andlibshout3-devbefore installing this package!_Below is the original README.—This is shout-python, a set of bindings for libshout 2.shout-python allows you to act as a source for icecast 1 and 2, and
shoutcast. This module includes inline documentation, or see
the included example.py for a demonstration of its usage.shout-python is licensed under the GNU LGPL. See COPYING for details.>NOTE: This version supports both Python 2 and Python 3
Package: python-signal
PythonSignal Signal/Event Python PyPackageA small implementation of signals, inspired by a snippet of Django signalInstallationUse the package managerpipto install foobar.pipinstallpython_sginal#Define NameSpacefrompython_signalimportNamespace_signals=Namespace()#recieveruser_login=_signals.signal('user_login')@user_login.connectdefafter_user_login(current_user):pass#senderuser_login.send(user)ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.LicenseMIT
Package: python-signal-edges
Signal EdgesSignal Edgesis a Python package capable of filtering, extracting state levels and edges of signals with millions
of samples, among other things. It is specially suited for analysis of analog signals obtained through recorders, such
as oscilloscopes or data recorders, and hardware automation in CI/CD environments, although it is flexible enough to
be used for many other different purposes.FindSignal EdgesonPyPi, or install it as follows:pip install python-signal-edgesRefer to the documentationherefor more details.DevelopmentClone the repository as:gitclonehttps://github.com/dmg0345/python-signal-edgesEnsure theGithubfile with the relevant environment variables exist as expected in thecompose.yamlfile and the
correct paths are set in themanage.ps1file for your environment. Afterwards, find the base Docker image for the
development container atDockerHub.To develop usingdevcontainersandVisual Studio Code:dockerpulldmg00345/python_signal_edges:latest./manage.ps1runCreate a releaseTo generate a release follow the steps below:Create areleasebranch fromdevelopbranch, e.g.release/X.Y.Z.Update version inconf.pyfile and inpyproject.tomlfile.Create pull request fromreleasebranch tomasterwith the changes with titleRelease X.Y.Z.When merged inmastercreate release and tag fromGithub, review production workflow passes for deployment.Delete therelease/X.Y.Zbranch.
Package: python-silk
pysilkInstallationLinux# clone this repocdPython-Silk-Module
pipinstallpybind11
pipinstall.windowspip install python-silkIf you get some issues with building, check documentation ofpybind11Usagefrompysilkimportasync_decode,async_encode,decode,encodeOnly four functions:encode,decode,async_encode,async_decodeIt's very easy to use. Just follow the IDE/editor typing intergration and check out the docs of these functionsNOTE:The first argumentinputcan be astr,pathlib.Path,bytes,BytesIOorBinaryIOliked object.strandpathlib.Pathare both meaning local file pathThe source data of input and returned data must be the original PCM coded dataAuthorDue to some reasons, these changes can't be merged into upstream, I have contacted the original author and kept the fork version as a separate projectDCZYewenLicenseAll the licenses are in the LICENSE file. This project is also released under BSD lisence.
Package: python-simple-caching
Simple CachingSmall project to standardize storing (key, value) data for caching purposes.Supported caching methods:DiskNpyFS- Numpy array exportMemoryDictMemory- keys are stored as dict keys and recalled from memoryExamplefrom simple_caching.storage import MemoryDict
import numpy as np
import time

def working_fn(image: np.ndarray) -> np.ndarray:
   """Working function that takes on average 0.2s"""
   if np.random.rand() <= 0.2:
      time.sleep(1)
   return (image - image.min()) / (image.max() - image.min())

data = np.random.randn(32, 240, 420, 3).astype(np.float32) # 32 images of 240x420 shape

# Standard version. Takes 0.2s in average per epoch for the same processing.
for i in range(100):
   new_data = [working_fn(image) for image in data]
   # do further processing with the result

# Cached version. We store the result on memory.

def key_encode_fn(image: np.ndarray) -> str:
   """Return a cachable key for each image. We use a string of mean + std that should be unique enough."""
   return f"{image.mean()}_{image.std()}"

cache = DictMemory(name="images", key_encode_fn=key_encode_fn)
# alternative, use: cache.map(working_fn, data)
for image in data:
   cache[image] = working_fn(image)

for i in range(100):
   new_data = [cache[image] for image in data]
   # do further processing with the resultDecoator version@cache_fn(NpyFS, key_encode_fn)
def working_fn(image: np.ndarray) -> np.ndarray:
   """Working function that takes on average 0.2s"""
   if np.random.rand() <= 0.2:
      time.sleep(1)
   return (image - image.min()) / (image.max() - image.min())

def key_encode_fn(image: np.ndarray) -> str:
   """Return a cachable key for each image. We use a string of mean + std that should be unique enough."""
   return f"{image.mean()}_{image.std()}"

for i in range(100):
   new_data = working_fn(image)
   # do further processing with the result
Package: python-simple-dto
python-simple-dtoDict, that behaves like an object.To achieve this BasicDTO and DTO were introduced.
They brings object-like attribute access appearance to dicts.
BasicDTO more suits for “flat” dict and DTO - for more complex.This Package doesn’t provides validation(there are more suitable tools today) and
“fromstring” functionality (single responsibility, you should load data by your own)Example of usageDTO>>>fromsrc.python_simple_dto.dtoimportDTO>>>test_dict={..."users":[{"name":"Alex","age":29},{"name":"Russel","age":19}]...}>>>test_dto{'users':[{'name':'Alex','age':29},{'name':'Russel','age':19}]}>>>test_dto.users[{'name':'Alex','age':29},{'name':'Russel','age':19}]>>>test_dto.roles=["guest","user","moderator"]>>>test_dto{'users':[{'name':'Alex','age':29},{'name':'Russel','age':19}],'roles':['guest','user','moderator']}>>>test_dto.roles['guest','user','moderator']>>>test_dto["roles"]['guest','user','moderator']
Package: python-simple-hipchat
DescriptionEasy peasy wrapper for theHipChat API v1. Exposes core URI endpoint wrapper and some basic methods for common integrations.DependenciesNone beyond the Python standard library.UsageInstall:pip install python-simple-hipchatInstantiate:import hipchat
hipster = hipchat.HipChat(token=YourHipChatToken)Request a URI endpoint as described in the HipChat API docs:hipster.method(url='method/url/', method="GET/POST", parameters={'name':'value', })Example:# List rooms
hipster.method('rooms/list')

# Post a message to a HipChat room
hipster.method('rooms/message', method='POST', parameters={'room_id': 8675309, 'from': 'HAL', 'message': 'All your base...'})API SugarTo send a message to a room, either a Notification or Admin token can be used. All other methods require an Admin token. SeeHipChat’s auth docsfor more information.Send a message to a room:room_id = 8675309
from_name = 'HAL'
message = 'All your base...'

hipster.message_room(room_id, from_name, message)

# per HipChat, color can be "yellow", "red", "green", "purple", "gray", or "random"
message_color = 'gray'
hipster.message_room(room_id, from_name, message, color=message_color)

# notify users in the room
message_color = 'red'
hipster.message_room(room_id, from_name, message, color=message_color, notify=True)List rooms:hipster.list_rooms()Find room by name:room = hipster.find_room('Room Name')
print "Room Name has room id = %s" % (room['room_id'])List users:hipster.list_users()Find user by name:user = hipster.find_user('Raleigh Becket')
print "Raleigh Becket's status is = %s" % (user['status'])Changelogv0.4.xAdded shortcut method for single room info(thanks @claudyus)Renamed GitHub repov0.3.xAdded shortcut method for listing users (thanks @Raizex)Added shortcut method for finding user by name (thanks @Raizex)Added shortcut method for finding room by name (thanks @Raizex)Added trove classifiers(thanks @ghickman)v0.2.xAdded Python 3 support without losing support for Python 2(thanks @pimterry)Expose timeout for safer synchronous use(thanks @zachsnow)v0.1.xAdded shortcut method for messaging a roomAdded shortcut method for listing rooms
Package: python-simple-hipchat-v2
DescriptionStripped down version of python-simple-hipchat for v2 hipchat api.  Currently only supports sending a message to a room.DependenciesNone beyond the Python standard library.UsageInstall:pip install python-simple-hipchat-v2Instantiate:import hipchat_v2
hipster = hipchat_v2.HipChat(url='https://url.to.hipchat')Example:# Post a message to a HipChat room
hipster.message_room(
  room_id=1234,
  message='all your base',
  color='yellow',
  token='abcdefg',
  notify=True)Changelogv0.1.xAdded shortcut method for messaging a room
Package: python-simple-logger
Simple Python loggerA simple logger for console/file logging with duplicate logs filter supportRelease new versionrequirementsExport GitHub tokenexportGITHUB_TOKEN=<your_github_token>release-itRun the following once (execute outside repository dir for example~/):sudonpminstall--globalrelease-it
npminstall--save-dev@release-it/bumperusageCreate a releasegitpull
release-it# Follow the instructionsUsagefromsimple_logger.loggerimportget_loggerlogger=get_logger(name=__name__,level=logging.DEBUG,filename="my-log.log")logger.info("This is INFO log")
Package: python-simplemail
Send emails with and without attachments.Installationpip install python-simplemailExampleimportsimplemailsimplemail.Email(smtp_server="localhost",smtp_user="my_username",smtp_password="my_password",from_address="sender@domain.at",to_address="recipient@domain.at",subject=u"This is the subject with umlauts (ÖÄÜß)",message=u"This is the short message body with umlauts (ÖÄÜß).").send()Find examples in the German Python-Forum:http://www.python-forum.de/viewtopic.php?f=11&t=3158LicensesGNU Library or Lesser General Public License (LGPL)MIT License
Package: python-simple-menu
python-simple-menuA lightweight console menu package for python applications. No frills, no fuss.InstallingTo install to your project, run the following command:pipinstallpython_simple_menuHow to usedefmain():main_menu=Menu(prompt="Main Menu")main_menu.items.append(FunctionItem("Item 1",__item1))main_menu.items.append(FunctionItem("Item 2",__item2))sub_menu1=Menu(prompt="Sub-Menu 1",parent=main_menu)sub_menu1.items.append(FunctionItem("Item 1",__item1))sub_menu1.items.append(FunctionItem("Item 2",__item2))main_menu.items.append(MenuItem(sub_menu1))main_menu.run()def__item1():print('lorem ipsum...')def__item2():print('dolor sit amet...')The menu will run until the user chooses Quit ("Q"), which will exit the
application. If the menu has a parent menu, an additional Back ("B") option
will be rendered which will return the user to the parent menu.See thepython_simple_menu/examplesdirectory for other usages.
Package: python-simplerelevance
A Python API wrapper for SimpleRelevance, free to use and BSD licensed.You can get an API key by signing up for SimpleRelevance.com on the site.
Signup is free.PredictionsThis is the part of SimpleRelevance that eventually costs
money to use. They will not be available right away, as our automated
model builds happen nightly. Please get in touch during business hours
if you want us to build a model sooner.DocumentationNote that documentation is available athttps://www.simplerelevance.com/api_doc
Package: python-simples
python-simples: A Python Library that Helps You Do Some Simple Worksinstallationpipinstallpython-simplesfeaturesSimpleStructure, simple directory structure that store data and output files.SimpleCellar, simple command line application installation that not in PATH environment.SimpleTask, simple task that you and create it in somewhere, run it in another place.usage1. SimpleStructureSimpleStructure is a suggested directory structure for command line software to run.
I often have such a need, there is a directory /path/to/root,
and several subdirectories are saved in this directory, which are:Data: The original data directory of the software runningOutput: software running output directoryfromsimplesimportSimpleStructuress=SimpleStructure('/path/to/root')ss('stdout.txt')ss('stderr.txt')ss('status.txt')ss.data_dirss.data('expression.txt')ss.output_dirss.output('diff-exprs.txt')2. SimpleCellarSimpleCellar was written to solve the problem of running some command line
software that is not in the PATH environment variable. For example, bioinformatics often needs to use blast.
If your BLAST is not in the environment variable, it is very troublesome to call it.fromsimplesimportSimpleCellarsc=SimpleCellar('/path/to/blast/install')sc.bin_dirsc.bin('blastn')sc.bin('blastp')3. SimpleTaskThe original intention of SimpleTask is to solve the problem of
remote running of command line software. That is, the parameter
specification of the command line software is not in the same
place as the operation (the most typical case is the web,
for example, the user specifies the parameters in the view,
and the executed process is a Celery Task).The solution is to:Create a serializable task typeThis type supports serialization and deserializationThe task object knows how to run itSo there is SimpleTask.fromsimplesimportSimpleTask,Option,Argument# you create task in some placest=SimpleTask('/path/to/root','ls')st.add_param(Option('-l'))st.add_param(Argument('-D','%Y-%m-%d'))st.add_param(Option('.))file=st.save()# you run in another placenew_st=SimpleTask.load_file(file)new_st.run()Files that SimpleTask generate:task.json, task serialization json, you can deserialize task object by this filestdout.txt, standard output message of this taskstderr.txt, standard error message of this taskstatus.txt, task status, -1 represents run failed, 0 represents running, 1 represent successful.
Package: pythonsimpleshell
INSTALL:pip3 install python-shellHow to use:Step 1:First create a file containing python code(will be executed when given command is used).
The file does not have to have a .py extension.To add arguments to your command, do it like this:args = REPLACEMEfor demonstration purposes i will use this simple code:args = REPLACEMEif(args[0] == "help"):
print("This command prints whatever you want. Arguments: [text to print]")
else:
for text in args:
print(text + " ", end="")Step 2:Create a new shell instance and add the command like this:from python-shell import shellcmdline = shell()
cmdline.add_command("echo", "/home/kiki/myfirstpythonscript/cmd/echo")Now, simply start the shell by adding this:cmdline.start()
Package: python-simple-shell
INSTALL:pip3 install python-shellHow to use:Step 1:First create a file containing python code(will be executed when given command is used).
The file does not have to have a .py extension.To add arguments to your command, do it like this:args = REPLACEMEfor demonstration purposes i will use this simple code:args = REPLACEMEif(args[0] == "help"):
print("This command prints whatever you want. Arguments: [text to print]")
else:
for text in args:
print(text + " ", end="")Step 2:Create a new shell instance and add the command like this:from python-shell import shellcmdline = shell()
cmdline.add_command("echo", "/home/kiki/myfirstpythonscript/cmd/echo")Now, simply start the shell by adding this:cmdline.start()
Package: python-sinklog
# Python SinklogLogging handler and CLI for Sinklog.com## Install```bash$ pip install python-sinklog```## UsageObtain a log key from https://sinklog.com/### CLI```bashusage: sinklog [-h] --key KEY [--host HOST] [--port PORT] [--format FORMAT][--level {WARN,INFO,DEBUG,ERROR}] [--tee][message]A simple logger for sinklog.compositional arguments:message               messages to logoptional arguments:-h, --help            show this help message and exit--key KEY, -k KEY     Sinklog.com log key--host HOST, -H HOST  Sinklog host--port PORT, -P PORT  Sinklog port--format FORMAT, -F FORMATPython log format--level {WARN,INFO,DEBUG,ERROR}, -l {WARN,INFO,DEBUG,ERROR}Python log level--tee, -t             when reading from stdin, copy to stdoutexample usage:# log a message on the command line$ sinklog -k <log key> "my log message"# log from stdin$ tail -f /var/log/myapp.log | sinklog -k <log key># usage in a pipeline$ tail -f /var/log/myapp.log | sinklog -k <log key> --tee | grep foo```### PythonAny Python script or app:```pythonimport loggingfrom sinklog import SinklogHandlersinklog = SinklogHandler(logkey="<log key>", transport="tls")logger = logging.getLogger()logger.setLevel(logging.INFO)logger.addHandler(sinklog)# Just use the logger as you would normally and log# messages will be forwarded to your Sinklog stream.logger.info("Hello Sinklog!")```### DjangoAdd `SinklogHandler` to your Django logging config:```python'handlers': {'sinklog': {'level': "DEBUG",'class': "sinklog.SinklogHandler",'logkey': "<log key>",'transport': "tls"}},'loggers': {'django.db.backends': {'level': 'ERROR','handlers': ['sinklog'],'propagate': False}}```### FlaskAdd `SinklogHandler` to Flask's root app logger:```pythonfrom sinklog import SinklogHandlersinklog = SinklogHandler(logkey="<log key>", transport="tcp")app.logger.addHandler(sinklog)```
Package: python-sjsclient
FeaturesSupports Spark Jobserver 0.6.0+Library Installation$ pip install python-sjsclientGetting startedFirst create a client instance:>>> from sjsclient import client
>>> sjs = client.Client("http://JOB_SERVER_URL:PORT")Uploading a jar to Spark Jobserver:>>> jar_file_path = os.path.join("path", "to", "jar")
>>> jar_blob = open(jar_file_path, 'rb').read()
>>> app = sjs.apps.create("test_app", jar_blob)Uploading a python egg to Spark Jobserver:>>> from sjsclient import app
>>> egg_file_path = os.path.join("path", "to", "egg")
>>> egg_blob = open(egg_file_path, 'rb').read()
>>> app = sjs.apps.create("test_python_app", egg_blob, app.AppType.PYTHON)Listing available apps:>>> for app in sjs.apps.list():
...     print app.name
...
test_app
my_streaming_appCreating an adhoc job:>>> test_app = sjs.apps.get("test_app")
>>> class_path = "spark.jobserver.VeryShortDoubleJob"
>>> config = {"test_config": "test_config_value"}
>>> job = sjs.jobs.create(test_app, class_path, conf=config)
>>> print("Job Status: ", job.status)
Job Status: STARTEDCreating a synchronous adhoc job:>>> job = sjs.jobs.create(test_app, class_path, conf=config, sync=True)
>>> print(job.result)
[2, 4, 6]Polling for job status:>>> job = sjs.jobs.create(...)
>>> while job.status != "FINISHED":
>>>     time.sleep(2)
>>>     job = sjs.jobs.get(job.jobId)Getting job config:>>> config = {"test_config": "test_config_value"}
>>> job = sjs.jobs.create(test_app, class_path, conf=config)
>>> job_config = job.get_config()
>>> print("test_config value: ", job_config["test_config"])
test_config_value: test_config_valueListing jobs:>>> for job in sjs.jobs.list():
...     print job.jobId
...
8c5bd52f-6486-44ee-9ac3-a8327ee40494
24b67573-3115-49c7-983c-d0eff0499b71
99c8be9e-a0ec-42dd-8a2c-9a8680bc5051
bb82f712-d4b4-43a4-8e4d-e4bb272e85dbLimiting jobs list:>>> for job in sjs.jobs.list(limit=1):
...     print job.jobId
...
8c5bd52f-6486-44ee-9ac3-a8327ee40494Creating a named context:>>> ctx_config = {'num-cpu-cores': '1', 'memory-per-node': '512m'}
>>> ctx = sjs.contexts.create("test_context", ctx_config)Running a job in a named context:>>> test_app = sjs.apps.get("test_app")
>>> test_ctx = sjs.contexts.get("test_context")
>>> config = {"test_config": "test_config_value"}
>>> job = sjs.jobs.create(test_app, class_path, ctx=test_ctx, conf=config)
>>> print("Job Status: ", job.status)
Job Status: STARTEDDocumentationhttp://python-sjsclient.readthedocs.orgDiscussion listspark-jobservergoogle group:https://groups.google.com/forum/#!forum/spark-jobserverRequirementsPython >= 2.7.0Licensepython-sjsclientis offered under the Apache 2 license.Source codeThe latest developer version is available in a github repository:https://github.com/spark-jobserver/python-sjsclient
Package: pythonskole
PythonskoleKoding med meningInstallerFor å installere siste versjon av kodebiblioteket, bruk pip fra din Python-konsoll eller kommandolinjevindu.pip install pythonskoleOm du allerede har installert pythonskole-biblioteket, kan du oppgradere til siste versjon medpip install --upgrade pythonskoleEksemplerTyngdekraftKodeeksempler med Tyngdekraft-modulenfrom pythonskole import Tyngdekraft
modell = Tyngdekraft(L=10.0,tittel="Ellipse")
#Nytt objekt i origo, med null hastighet og masse=500. 
modell.nyttObjekt([0,0],[0,0],500.) 
#Nytt objekt til venstre for origo og hastighet i y-retning og masse=10
modell.nyttObjekt([-5.0,0],[0,2.0],10.) 
modell.start()#Mer informasjon
Les mer påpythonskole.nofor eksempler og forklaring på disse kodene. Du kan også lese og laste ned kodene pågithub.com.