Saravanan666/pypi-org huggingface dataset:
Package: opower
opowerA Python library for getting historical and forecasted usage/cost from utilities that use opower.com such as PG&E.Supported utilities (in alphabetical order):American Electric Power (AEP) subsidiariesAEP OhioAEP TexasAppalachian PowerIndiana Michigan PowerKentucky PowerPublic Service Company of Oklahoma (PSO)Southwestern Electric Power Company (SWEPCO)City of Austin UtilitiesConsolidated Edison (ConEd)Orange & Rockland Utilities (ORU)Duquesne Light Company (DQE)Enmax EnergyEvergyExelon subsidiariesAtlantic City ElectricBaltimore Gas and Electric (BGE)Commonwealth Edison (ComEd)Delmarva PowerPECO Energy Company (PECO)Potomac Electric Power Company (Pepco)Pacific Gas & Electric (PG&E)Portland General Electric (PGE)Puget Sound Energy (PSE)Sacramento Municipal Utility District (SMUD)Seattle City Light (SCL)Support a new utilityTo add support for a new utility that uses opower JSON API (you can tell if the energy dashboard of your utility makes network requests to opower.com, e.g. pge.opower.com in the network tab of your browser's developer tools) add a file similar topge.pyorpse.pyorbge.pyetc.Name the file after the utility website, e.g. pge.py for pge.com.Since this library is used by Home Assistant, seehttps://www.home-assistant.io/integrations/opower/, perhttps://github.com/home-assistant/architecture/blob/master/adr/0004-webscraping.mdwe cannot have a dependency on a headless browser and we can only parse HTML during login.An exception is made for the authentication phase. An integration is allowed to extract fields from forms. To make it more robust, data should not be gathered by scraping individual fields but instead scrape all fields at once.So follow that advice and try to scrape all fields at once, similar to theget_form_action_url_and_hidden_inputsin helpers.py.ExampleSeedemo.pyDevelopment environmentpython3-mvenv.venvsource.venv/bin/activate# for Windows CMD:# .venv\Scripts\activate.bat# for Windows PowerShell:# .venv\Scripts\Activate.ps1# Install dependenciespython-mpipinstall--upgradepip
python-mpipinstall.# Run pre-commitpython-mpipinstallpre-commit
pre-commitinstall
pre-commitrun--all-files# Alternative: run formatter, lint, and type checkingpython-mpipinstallisortblackflake8ruffmypy
isort.;black.;flake8.;ruff.--fix;mypy--install-types.# Run testspython-mpipinstallpytestpython-dotenv
pytest# Run demopythonsrc/demo.py--help# To output debug logs to a file, change DEBUG_LOG_RESPONSE to True in opower.py and run:pythonsrc/demo.py--verbose2>out.txt# Build packagepython-mpipinstallbuild
python-mbuild
Package: oppa
Oppa is not PowerPoint like Application! It’s lecture and presentation support tool. It allows free drawing with basic colors over every part of screen.UsageStart oppa using:$oppa--helpusage:oppa[-h][-o][-z]optionalarguments:-h,--helpshowthishelpmessageandexit-o,--opaquestartinopaquemode-z,--minimizedstartminimizedAfter starting oppa opens top level transparent window on which one can draw using left mouse button. Apart from drawing following actions (keys) are available: “r”, “g”, “b”, “w” change drawing color to red, green, blue and white accordingly; “e” switches to eraser mode; “space” minimizes oppa; left click on icon in tray restores minimized oppa; “t” toggles transparency and “del” erases all drawing.WindowsOn Windows, after installation there are two programs (located in C:\Python27\Scripts): oppa and oppaw. First one is used to run oppa with command line window second without.RequirementsOppa currently is developed and tested on Linux using Python 2.7. It requires PyGTK and Pycairo. For drawing in transparent window composited (either using XRender or OpenGL) screen is required - oppa will complain and use only opaque mode without composited screen.Starting from version 0.5.0 there is experimental support for Windows (Windows 2000 and newer).InstallationThe latest stable version is available to install usingpip:$pipinstalloppaWindowsInstallation on Windows is essentially the same as on Linux. But first one need to have Python 2.7 with pip. Following steps might be used to install oppa from scratch on Windows:Install Python using latest Python 2 frompython.org(default installation folder is C:\Python27).Install PyGTK and Pycairo using latest all-in-one installer frompygtk.org.Install latest setuptools using ez_setup.py fromsetuptools installation.C:\Python27>python.exe ez_setup.pyInstall pip using get-pip.py frompip installation.C:\Python27>python.exe get-pip.pyInstall oppa using pip.C:\Python27\Scripts>pip.exe install oppa
Package: op-package
Практическая работа №6 - Модульные программыЭрлан Назарбеков,КИ22-16/1Б,Вариант 24$ python example.py -v— примеры$ python generate_random.py— функция для генерации случайного списка$ python sort_acdending.py— функция для сортировки перемешиванием (по возрастанию)$ python sort_decsending.py— функция для сортировки перемешиванием (по убыванию)example:fromop_package.tests.sort_ascendingimportcocktail_sort_increasingprint(cocktail_sort_increasing([5,6,8,3,2,1]))fromop_package.sort_descendingimportcocktail_sort_decreasingprint(cocktail_sort_decreasing([5,6,8,3,2,1]))[1, 2, 3, 5, 6, 8][8, 6, 5 ,3 ,2, 1]
Package: oppai
osu! pp and difficulty calculator. automatically generated C bindings forhttps://github.com/Francesco149/oppai-ngusagepipinstalloppai#!/usr/bin/env pythonimportsysfromoppaiimport*ez=ezpp_new()ezpp(ez,sys.argv[1])print("%gpp"%ezpp_pp(ez))ezpp_free(ez)./example.py/path/to/file.osupython-c'help("oppai")'for a list of functions, or just read the top of oppai.c for better doclimitationsfor some reason, python3 doesn’t provide a persisting pointer to strings
you pass to c code even if you aren’t doing anything with them, so if you
want to reuse the handle at all you have to use ezpp_dup and ezpp_data_dup,
which create a copy of the strings you pass in. this is inefficient so
it’s recommended to use autocalc mode and only call ezpp_dup or
ezpp_data_dup when you’re actually changing map
Package: oppaikawata
osu! pp and difficulty calculator. automatically generated C bindings forhttps://github.com/Francesco149/oppai-ngusagepipinstalloppai#!/usr/bin/env pythonimportsysfromoppaiimport*ez=ezpp_new()ezpp(ez,sys.argv[1])print("%gpp"%ezpp_pp(ez))ezpp_free(ez)./example.py/path/to/file.osupython-c'help("oppai")'for a list of functions, or just read the top of oppai.c for better doclimitationsfor some reason, python3 doesn’t provide a persisting pointer to strings
you pass to c code even if you aren’t doing anything with them, so if you
want to reuse the handle at all you have to use ezpp_dup and ezpp_data_dup,
which create a copy of the strings you pass in. this is inefficient so
it’s recommended to use autocalc mode and only call ezpp_dup or
ezpp_data_dup when you’re actually changing map
Package: oppaipy
oppaipyoppaipy is a simple object-oriented python3 wrapper around the python bindings ofoppai-ng.Usage$ pip install oppaipyThere are 5 steps to using oppaipy:InitialiseSet parametersCalculateCheck resultsRelease resourcesExample>>>importoppaipy>>>calc=oppaipy.Calculator()>>>calc.set_beatmap("/path/to/beatmap")>>>calc.set_misses(1)>>>calc.set_combo(2354)>>>calc.calculate()>>>print(calc.pp)727.3976135253906>>>calc.close()There is some extra syntactic sugar to make it shorter for simple usage howeverSimple example>>>importoppaipy>>>withoppaipy.Calculator("/path/to/beatmap",misses=1)ascalc:...print(calc.calculate())(7.8976135253906,727.3976135253906)API# Setting parametersCalculator.set_beatmap(beatmap_path)Calculator.set_mods(mods)Calculator.set_combo(combo)Calculator.set_accuracy_percent(accuracy)Calculator.set_accuracy(count_100,count_50)Calculator.set_misses(misses)Calculator.set_score_version(score_version)Calculator.set_base_ar(ar)Calculator.set_base_od(od)Calculator.set_base_cs(cs)Calculator.set_base_hp(hp)Calculator.reset()# CalculatingCalculator.calculate()# Getting valuesCalculator.ppCalculator.aim_ppCalculator.speed_ppCalculator.acc_ppCalculator.starsCalculator.aim_starsCalculator.speed_stars# CleanupCalculator.close()Why should I use this?You get the speed of the C bindings with a pythonic object interface.Why the name "oppaipy"?I already used "OOppai" forthe wrapper of the original oppai's bindings, and I didn't like the look of "OOppai-ng".
Package: oppapi
oppapīErgonomic option parser on top ofdataclasses, inspired bystructopt.UsagefromtypingimportOptionalfromoppapiimportfrom_args,oppapi@oppapiclassOpt:"""Option parser using oppapi"""host:str""" This will be positional argument of type `str` """port:Optional[int]=8000""" Optional argument will be option argument """opt=from_args(Opt)print(opt)The code above generates such option parser thatGenerates parser description from class's docstringGenerates argument description from field's docstringA field will be a positional argumentAn optional field will be an optional argumentSee the parser help message:$ python simple.py -h
usage: simple.py [-h] [-p PORT] host

Option parser using oppapi

positional arguments:
  host                  This will be positional argument of type `str`

optional arguments:
  -h, --help            show this help message and exit
  -p PORT, --port PORT  Optional argument will be option argumentRunning the program deserializes the command line arguments into an object of the declared class.$ python simple.py localhost -p 20000
Opt(host='localhost', port=20000)Supported typesPrimitives (int,float,str,bool)Containers (List,Tuple)typing.OptionalEnumandIntEnumdatetimedecimalipaddresspathlibuuidshort/longoppapigenerates flag names automatically, but you can specify arbitrary short/long names.fromtypingimportOptionalfromoppapiimportfrom_args,oppapi,field@oppapiclassOpt:host:Optional[str]=field(short="-n",long="--hostname")enumenum.Enumandenum.IntEnumwill be an argument withchoicesparameter.classFood(Enum):A="Apple"B="Beer"C="Chocolate"classPrice(IntEnum):A=10B=20C=30@oppapiclassOpt:food:Foodprice:Optional[Price]usage will be like this:positional arguments:
  {Apple,Beer,Chocolate}

optional arguments:
  -h, --help            show this help message and exit
  -p {10,20,30}, --price {10,20,30}oppapi converts the command line arguments back to Enum.$pythonchoice.pyApple--price20Opt(food=<Food.A:'Apple'>,price=<Price.B:20>)List/TupleListwill be an arbitrary number of arguments (nargs="+").Tuplewill be a fixed number of arguments (nargs=NUM).@oppapiclassOpt:values:List[int]opts:Optional[Tuple[int,str,float,bool]]$ python nargs.py 1 2 3 --opts 10 foo 10.0 True
Opt(values=[1, 2, 3], opts=(10, 'foo', 10.0, True))SubCommandUnionof dataclasses will be subcommands.@oppapiclassFoo:a:int@oppapiclassBar:a:strb:Optional[int]@oppapiclassOpt:sub:Union[Foo,Bar]usage: subcommand.py [-h] {foo,bar} ...

positional arguments:
  {foo,bar}

  optional arguments:
    -h, --help  show this help message and exitFlattenTODOLICENSEThis project is licensed under theMIT license
Package: op-parser
Executable UML External Entity Operation ParserParses an *.op file (operation) to yield an abstract syntax tree using python named tuplesWhy you need thisYou need to process an *.op file in preparation for populating a database or some other purposeInstallationCreate or use a python 3.11+ environment. Then% pip install op-parserAt this point you can invoke the parser via the command line or from your python script.From your python scriptYou need this import statement at a minimum:from op-parser.parser import OpParserYou then specify a path as shown:result = OpParser.parse_file(file_input=path_to_file, debug=False)Theresultwill be a list of parsed operation statements. You may find the header of thevisitor.pyfile helpful in interpreting these results.From the command lineThis is not the intended usage scenario, but may be helpful for testing or exploration. Since the parser
may generate some diagnostic info you may want to create a fresh working directory and cd into it
first. From there...% eeop arrived-at-floor.opThe .op extension is not necessary, but the file must contain operation text. See this repository's wiki for
more about the xsm language. The grammar is defined in theoperation.pegfile. (if the link breaks after I do some update to the code,
just browse through the code looking for the operation.peg file, and let me know so I can fix it)You can also specify a debug option like this:% eeop arrived-at-floor.op -DThis will create a diagnostics folder in your current working directory and deposit a couple of PDFs defining
the parse of both the state model grammar:operation_tree.pdfand your supplied text:operation.pdf.You should also see a file namedop-parser.login a diagnostics directory within your working directory
Package: oppe
oppe-for-pythonAn API wrapper forOppewritten in Python.InstallationpipinstalloppeUsageSending an eventfromoppeimportOppefromoppe.exceptionsimportEventRequestErroroppe=Oppe(api_token='insert-api-token-here',project_id="uuid-of-project")try:oppe.event(channel_id="uuid-of-channel",title="user-registered",description="A new user has registered.",emoji="👋",data={"user_id":123,},)exceptEventRequestErrorase:# Handle errorprint(e)
Package: oppen-pretty-printer
oppen-pretty-printerThis package is a faithful translation, to python, of the
pretty-printing algorithm developed by DEREK C. OPPEN at Stanford  University
in the late 1970s. The appendix ofPRETTY PRINTING, Derek C. Oppen, 1979contains
the original prettyprint program written inMESAA much quoted, more recent algorithm,A prettier printer, Philip Wadler 2003refers to
Oppen, saying, "The pretty printer presented here uses an algorithm equivalent to Oppenâ€™s, but presented
in a functional rather than an imperative style". Many of todays pretty printer implementations
are based on the Wadler algorithm. So, in a way, the road leads back to Derek C. Oppen, 1979.Two python versions are included.pretty_oppen.pyis, as far as possible, a
line-by-line translation of the Oppen algorithm fromMESAto Python.pretty.pyis
functionally identical topretty_oppen.pybut written using a more Pythonic idiom.Pytest tests and example output are included for both versions.Usagepip install oppen-pretty-printerExample:from oppen_pretty_printer import pprint, Token as T

tokens = [
    T.BEGIN(),
    T.STRING("begin"),
    T.STRING("x"),
    T.BREAK(), T.STRING(":="), T.BREAK(),
    T.STRING("40"),
    T.BREAK(), T.STRING("+"), T.BREAK(),
    T.STRING("2"),
    T.STRING("end"),
    T.END(),
    T.EOF()]

pprint(tokens)DocumentationHead over to theREADMEfor more details.ContributingThe source code foroppen-pretty-printeris availableon GitHub. If you find a bug or something is unclear, we encourage
you to raise an issue. We also welcome contributions, to contribute, fork the
repository and open apull request.
Package: opper
opperRefresh yourself on what those elusive options do, hassle free!ExampleView the descriptions of -xcf and –format in the given order:python3 optx.py tar -xcfNotesFor the sake of my sanity, I will refer to the optional arguments for this
program as flags, and the positional arguments as options.ContributingThis project is still in the beginning stages. Contributions are very welcome.LicenseThis software is licensed under GPLv3. See theLICENSEfile for more information.
Package: opperai
Opper Python SDKInstallpipinstallopperaiUsing thefndecoratorfromopperaiimportfn@fn()deftranslate(text:str,target_language:str)->str:"""Translate text to a target language."""print(translate("Hello","fr"))>>>"Bonjour"Thefndecorator automatically creates an Opper function ready to be called like any other function in your code. They're no different than any other function!Calling functions manuallyTo call a function you created athttps://platform.opper.aiyou can use the following code:fromopperaiimportClientfromopperai.typesimportChatPayload,Message# Use AsyncClient for async operationsclient=Client(api_key="your-api-key")response=client.functions.chat("your-function-path",ChatPayload(messages=[Message(role="user",content="hello")]))print(response)This more traditional API is better targeted for chat use cases.Retrievalclient.indexes.retrieve(index_id=42,"Who is the president of the USA?",3)ConfigurationEnvironment variableTheOPPER_API_KEYenvironment variable is read by the SDK if noapi_keyis provided to theClientobject.When using thefndecorator the SDK client is automatically initialized with theOPPER_API_KEYenvironment variable.
Package: opponent-adjusted-nba-scraper
Opponent Adjusted NBA ScraperThis is a package that collects data fromstats.nba.comand provides methods focused on adjusting a player's statistics by their opponents defensive strength.InstallingViapipInstall using the following command:pip install opponent_adjusted_nba_scraperVia GitHubOr, you can clone this repo to a Git repository on your local machine.AboutThis is my first time writing a PyPi package, and I'm glad I decided to do this because it makes the process of adjusting player's stats that I've worked on for years a lot easier and faster. The stats required for this scraper only go back to the 1996-97 season, which would not have been the case if I had usedbasketball-reference. However, I couldn't find a way to access playoff stats on bball-ref, so I'm hoping to find a way to access these stats and update this scraper to allow for searches before the '97 season.APIYou can find the full details for this APIhere.CreditsI borrowed the implementation forlookup.pyand the names of all NBA players up to the 2020-21 season innames.txtfromVishaal Agartha.
Package: opportini-pdfbuilder
# opportini_html2pdf
Python microservice to generate PDF from HTML## generate PDF from HTML directly
PYTHONPATH=. python html2pdf_converter/converter.py –from_html 1 –html_file templates/void-report.html -o test.pdf -e 0## generate PDF from template
PYTHONPATH=. python html2pdf_converter/converter.py –from_html 0 -o test.pdf -e 0 –temp_html_base_dir /Users/phoenix/Documents/Projects/CI/HTMLs
PYTHONPATH=. python html2pdf_converter/converter.py –from_html 0 -o test.pdf -e 0 –temp_html_base_dir ./HTMLs
Package: oppoudpsdk
oppoudpsdkPython SDK for Oppo UDP-20x media devices.
The primary goal is to use this to power integrations forHome Assistant.Installationpip install oppoudpsdkUsageSimple exampleasync def main():
  logging.basicConfig(level=logging.DEBUG, format='%(asctime)-15s %(levelname)-8s %(message)s')

  loop = asyncio.get_event_loop()
  client = OppoClient(HOST_NAME, 23, loop)
  client.add_event_handler(EVENT_DEVICE_STATE_UPDATED, on_device_state_updated)
  await asyncio.ensure_future(client.async_run_client(), loop=loop)

if __name__ == "__main__":
  asyncio.run(main())Please seesimple_example.pyfor a full working example of usage of this library.ObjectsOppoClient(host_name, port_number = 23, mac_address = None, event_loop = None)The main client class that initiates and maintains a connection with the Oppo device.  Handles the raw communications between the client and the device.OppoDevice(client, mac_addr)A class that describes a media device.  This is abstracted from the client so that the media functionality is isolated from the communications infrastructure.API OverviewPlease refer to this document for the Oppo IP control API:http://download.oppodigital.com/UDP203/OPPO_UDP-20X_RS-232_and_IP_Control_Protocol.pdf
Package: opprint
installationpython3 -m pip install opprintusageop(arg,var=None,format=False,yml=False)from opprint import op
greeting = 'hello world!'

# basic
op(greeting)

# with label
op('op says...', greeting)

# with standard format
op(greeting, format=True)

# with yaml format
op(greeting, format=True, yml=True)

# with all params
op('op says...', greeting, format=True, yml=True)
Package: opps
AnOpen Source Content Managementfor themagazinewebsites andhigh-traffic, using the Django Framework.DocumentationSee here thefull documentation.SponsorYACOWSDigital OceanCampus PartyLicenseoppsis licensed under theMIT LicenseCopyright (c) 2015 Opps Project. and other contributorsPermission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package: opps-comments
Installpipinstall-egit+https://github.com/opps/opps-comments.git#egg=opps-commentsConfigurationIncludeopps.commentson your django settings:INSTALLED_APPS+=('opps.comments',)Add Opps Comments credentials on your django settings:OPPS_COMMENTS={"disqus":{"shortname":"opps",},"facebook":{"APP_ID":"123456"},"google":{}}Used{% load comments_tags %}
{% load_comments %}
Package: opps-feedcrawler
opps-feedcrawler================FeedCrawler takes a **feed** of any type, executes its customized processor in order to create CMS Entries.Feed====Feed is commonly a url with some configurations, **url**, **credentials**, **processor** and **actions**The most simple example is an RSS feed- url = 'http://site.com/feed.rss'- processor = 'opps.feedcrawler.processors.rss.RSSProcessor'- actions = ['opps.feedcrawler.actions.rss.RSSActions'In the above example we have an **url** to read feed entries, and feedcrawler comes with a builtin processor for RSS feeds**RSSProcessor** wil take the feed url and do all the job fetching, reading and creating **entries** on database.> You can replace RSSProcessor with your own processor class, following the processor API.> Example: 'yourproject.yourmodule.processors.MyProcessor'> The processor API is documented in the item **Processor API**Also, your **feed** takes **actions** which is a path to a callable returning a list of Django admin actions in the form of functions.an example of action is "Create posts" which takes the selected entries and convert it in to Opps Posts.Processor API=============feedcrawler provides a **BaseProcessor** class for you to extend and you have to override some methods.from opps.feedcrawler.processors.base import BaseProcessorclass MyProcessor(BaseProcessor):"""BaseProcessor.__init__ receives the **feed** object as parameterdef __init__(feed, entry_model, *args, **kwargs):self.feed = feedself.entry_model = entry_modelYou override if you need, but be careful."""def process(self):url = self.feed.source_urlmax_entries = self.feed.max_entries...# here you have access to the **feed** object in **self.feed**entries = read_and_parse_rss_feed(url)  #  example function which fetch and parse XML feed# Now you have access to **self.entry_model** which you will use to create CMS entries.for entry in entries:# remember to implement your own logic to avoid duplicationsself.entry_model.objects.get_or_create(title=entry['title']......)# this method should return the count of entries read and created or 0return len(entries)The processor above will be executed by management command **manage.py process_feeds -f feed_slug** also you can put this command to run on **cron** or **celery**
Package: opps-ganalytics
opps.ganalyticsOpps Google Analytics ApplicationAccess Google Analytics APIFiltersTemplate tagDependenciesRabbitMQ (Celery)Requirementsoppsdjango-celerygoogle-api-python-clientSettings varOPPSGANALYTICS_ACCOUNT - _Generated email byservice accountcredencial. (example: @developer.gserviceaccount.com)OPPSGANALYTICS_PRIVATE_KEY -_path to .pem key, converted from service account .p12 key,see more.TaskGet accounts -Get all Google Analytics AccountsGet metadata -Sync metadata, run 4 in 4 hours