Saravanan666/pypi-org huggingface dataset:
Package: nytcomments
The package includes three main functions to perform three distinct tasks involving the retrieval of comments’ and articles’ from New York Times as ready-to-use dataset for data science/machine learning projects:The main functionget_datasetreturns two dataframes - one each for the articles and the comments on them. The retrieval can be customized based on a number of optional parameters such as a specific timeline for the articles, search keywords, filter queries based on a number of options such as the week of the day, the word count of the articles, source, etc., maximum limit on the number of comments or articles or both, sorting the articles chronologically based on either the newest or oldest articles, option to suppress or activate the output log for the process, option to save the data as twocsvfiles, etc. The function returns only the articles that were open to comments along with the comments on them.The functionget_articlescan be used as an API wrapper for NYT article search API. It returns the cleaned up and preprocessed data for articles as a ready-to-use pandas dataframe (with an option to store it incsvfiles). The retrieval can be customized with the same options as above and unlike the above function, it returns all the articles that satisfy the search criteria.The functionget_commentsretrieves the comments on NYT article(s) given their urls. It can be used as a substitute for the comments by url option in the NYT Community API that is now deprecated and only return comments that were picked as editor’s selection on account of anunresolved issue. This function does not use NYT API for the retrieval unlike the above two.DependenciesPython 3.4+pandasrequestsUsagefromnytcomments.nytcommentsimportget_datasetarticles_df,comments_df=get_dataset(ARTICLE_API_KEY,page_lower=0,page_upper=2)Please refer to thetutorial herefor illustration of the three functionsget_dataset,get_commentsandget_articlesas well as detailed information about the function arguments. The functionsget_datasetandget_articlesrequires the use of NYT API key that can be obtained by registering at theNYT developers’ sitewhereasget_commentscan be used without the API key. You must agree to theTerms of Usefor the NYT article search API to use the key.Note : The dataset of comments posted on NYT articles in the period Jan - May 2017 and Jan - April, 2018 isavailable on Kaggleand is at thetop among the 20 featured datsetsas of April 28, 2018.AcknowledgementThe url used to retrieve comments from a given article in the functionget_commentsis taken from theblog by Neal Caren.NYT article search API is used for the article search.
Package: nyt-docket
Getting startedpip install nyt-docketUsing nyt-docketCommand-line interfacedocket grants 2015
docket orders 2015
docket opinions 2015Demo appRun the demo app.python -m docket.demoModulesUse the docket loader manually from within your Python script.Grants (new cases)Grants are cases that have been granted certiorari and will be heard by
the Court in this term. The most interesting thing about a grant,
besides its existence, is the question the Court will be deciding. This
is associated as a separate PDF file on the Court’s site but the parser
attaches it to the case as a text blob.fromdocketimportgrantsg=grants.Load()g.scrape()forcaseing.cases:printcase.__dict__Slip opinions (decisions)Slip opinions are decisions in cases the Court has either heard
arguments on or has made a procedural decision on. These opinions are
not final, but it’s the fastest way to know when the Court has acted on
a case. The most important feature of a slip opinion is the opinion
text, which is a separate PDF file. This is associated with the opinion
as a hyperlink.fromdocketimportslipopinionso=slipopinions.Load()o.scrape()forcaseino.cases:printcase.__dict__Orders (all kinds of things)Orders are the daily business of the Court. Denials of certiorari as
well as various other procedural motions are resolved in the orders
list. This plugin grabs the long orders list itself as a PDF link and
then parses it out into individual cases. WARNING: The individual cases
rely on regex and tomfoolery. The methods for parsing them are fragile,
so YMMV.fromdocketimportordersz=orders.Load()z.scrape()z.parse()fororderinz.orders:printorder.__dict__forcaseinz.cases:print"%s\t%s\t%s"%(case.docket,case.orders_type,case.casename)
Package: nyt-entity-uploader
A wrapper for making requests to theNYT Entity Service
API.UsageFirst: You should be running an instance of theNYT Entity Service
API.Second: You should exportENTITYSVC_BASE_URLbefore running the
uploader to point to your own running entity service API endpoint.Example 1: As a python moduleYou can run the uploader as a python module and pass the name as a
keyword argument.$ export ENTITYSVC_BASE_URL='http://localhost.newsdev.net:8000'
$ python
Python 3.6.1 (default, Apr  4 2017, 09:40:21)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from entity_uploader import UploadEntity
>>> e = UploadEntity(name="Bank of America")
>>> e.to_dict()
{'name': 'Bank of America', 'uuid': 'f514b0e1-eea5-4676-aed2-2f9ee501cd5e', 'score': 0, 'created': True}Example 2: Running example.pyexample.pyis a sample implementation that reads a list of entity
names fromexample_entities.txt.$ export ENTITYSVC_BASE_URL='http://localhost.newsdev.net:8000'
$ python example.py

{'name': 'Bank of America', 'uuid': 'f514b0e1-eea5-4676-aed2-2f9ee501cd5e', 'score': 0, 'created': True}
{'name': 'Bank of America', 'uuid': 'f514b0e1-eea5-4676-aed2-2f9ee501cd5e', 'score': 95, 'created': False}
{'name': 'Bank of America', 'uuid': 'f514b0e1-eea5-4676-aed2-2f9ee501cd5e', 'score': 100, 'created': False}
{'name': "banque d'amerique", 'uuid': 'cb626971-1989-4d78-870d-e6835017c936', 'score': 62, 'created': True}
{'name': 'Bank of America', 'uuid': 'f514b0e1-eea5-4676-aed2-2f9ee501cd5e', 'score': 95, 'created': False}
{'name': 'Bank of America', 'uuid': 'f514b0e1-eea5-4676-aed2-2f9ee501cd5e', 'score': 90, 'created': False}
{'name': 'Bank of America', 'uuid': 'f514b0e1-eea5-4676-aed2-2f9ee501cd5e', 'score': 86, 'created': False}
{'name': 'Bank of America', 'uuid': 'f514b0e1-eea5-4676-aed2-2f9ee501cd5e', 'score': 86, 'created': False}
{'name': 'Bank of America', 'uuid': 'f514b0e1-eea5-4676-aed2-2f9ee501cd5e', 'score': 86, 'created': False}In this example, the defaultcreate_if_belowscore is 80. The first
entity,Bank of Americais created. The next entity,Bank of America, N.A.is not created because it has a similarity
score of 95. The UUID of the matching entity,Bank of America, is
returned. The same is true for the next entity,BANK OF AMERICA,
which has an even higher score of 100. The next entity,banque d'amerique, is created as a new entity because it has a
matching score of 62, which is lower than the defaultcreate_if_belowscore of 80. The last few entities inexample_entities.txtmatch the first entity with varying degrees of
closeness.
Package: nytimesarticle
===========nytimesarticle===========nytimesarticle is a fully-functional Python wrapper for the New York Times Article Search API.Installation=========With pip::$ pip install nytimesarticleor easy_install::$ easy_install nytimesarticleDependencies=========nytimesarticle requires the `requests <https://pypi.python.org/pypi/requests>`_ package.Usage=========Simply import and initialize the API with your developer key::$ from nytimesarticle import articleAPI$ api = articleAPI('*Your Key*')And call the 'search' function with your desired search parameters/values::$ articles = api.search( q = 'Obama', fq = {'headline':'Obama', 'source':['Reuters','AP', 'The New York Times']}, begin_date = 20111231, facet_field = ['source','day_of_week'], facet_filter = True )The search function returns a dictionary of the search results.You can specify multiple filters by using a dictionary::fq = {'headline':'Obama', 'source':['Reuters','AP', 'The New York Times']}And multiple values by using a list::facet_field = ['source','day_of_week']More examples::$ articles = api.search( q = 'Obama' )$ articles = api.search( q = 'Obama', begin_date = 20111231, page=2 )For a complete overview of the available search parameters, please refer to the NYTimes Article Search API `Documentation <http://developer.nytimes.com/docs/read/article_search_api_v2>`_.
Package: nytimesarticlev2
nytimesarticlev2is a fully-functional Python wrapper for theNew
York Times Article Search
API.InstallationWith pip:$ pip install nytimesarticlev2Dependenciesnytimesarticlev2 requires the`requests<https://pypi.python.org/pypi/requests>`__ and`setuptools<https://pypi.python.org/pypi/setuptools>`__ packages.UsageSimply import and initialize the API with your developer key:>>>fromnytimesarticlev2importarticleAPI>>>api=articleAPI("YourAPIKey")Then call thesearchfunction with your desired search
parameters/values:>>>articles=api.search(q="Obama",fq={"headline":"Obama","source":["Reuters","AP","The New York Times"]},begin_date="20161023",# this can also be an intfacet_field=["source","day_of_week"],facet_filter=True)The search function returns a Python dictionary of the search results.You can specify multiple filters by using a dictionary:.. code:: python>>> fq = {"headline": "Obama", "source": ["Reuters", "AP", "The New York Times"]}And multiple values by using a list:.. code:: python>>> facet_field = ["source", "day_of_week"]More examples:>>>articles=api.search(q="Obama")>>>articles=api.search(q="Obama",begin_date="20111231",page=2)For a complete overview of the available search parameters, please refer
to theNYTimes Article Search API
Documentation.HistoryThis package was originally written byEvan
Sherlockas`nytimesarticle<https://github.com/evansherlock/nytimesarticle>`__.
It has since been forked and updated byMatt
Morrison, and subsequently released as`NyTimesArticleAPI<https://pypi.python.org/pypi/nytimesarticlev2>`__,
with contributions fromGerald SpencerandAndrew Han.License© 2016 Matt Morrisonmattdmo@pigimal.com.This is free software. It is licensed under theMIT
License. Feel free to use this
in your own work. However, if you modify and/or redistribute it, please
attribute me in some way, and distribute your work under this or a
similar license. A shout-out or a beer would be appreciated.
Package: nytimes-scraper
nytimes-scraperScrape article metadata and comments from NYTimesSetuppipinstallnytimes-scraperCLI usageThe scraper will automatically fetch every article and all the user comments published onnytimes.com.
Articles are processed month by month, starting with the current month.
For each month, a{year}-{month}-articles.pickleand{year}-{month}-comments.picklewill be
generated in the current directory.
If the process is restarted, existing outputs will not be overridden and the scraper will continue
at the month where it left off.
To use it, runpython-mnytimes_scraper<API_KEY>Programmatic usageThe scraper can also be started programmaticallyimportdatetimeasdtfromnytimes_scraperimportrun_scraper,scrape_month# scrape february of 2020article_df,comment_df=scrape_month('<your_api_key>',date=dt.date(2020,2,1))# scrape all articles month by monthrun_scraper('<your_api_key>')Alternatively, thenytimes_scraper.articlesandnytimes_scraper.commentsmodules can be used for more
fine-grained access:importdatetimeasdtfromnytimes_scraper.nyt_apiimportNytApifromnytimes_scraper.articlesimportfetch_articles_by_month,articles_to_dffromnytimes_scraper.commentsimportfetch_comments,fetch_comments_by_article,comments_to_dfapi=NytApi('<your_api_key>')# Fetch articles of a specific montharticles=fetch_articles_by_month(api,dt.date(2020,2,1))article_df=articles_to_df(articles)# Fetch comments from multiple articles# a) using the results of a previous article queryarticle_ids_and_urls=list(article_df['web_url'].iteritems())comments_a=fetch_comments(api,article_ids_and_urls)comment_df=comments_to_df(comments_a)# b) using a custom list of articlescomments_b=fetch_comments(api,article_ids_and_urls=[('nyt://article/316ef65c-7021-5755-885c-a9e1ef2cfdf2','https://www.nytimes.com/2020/01/03/world/middleeast/trump-iran-suleimani.html'),('nyt://article/b2d1b802-412e-51f7-8864-efc931e87bb3','https://www.nytimes.com/2020/01/04/opinion/impeachment-witnesses.html'),])# Fetch comment for one specific article by its URLcomments_c=fetch_comments_by_article(api,'https://www.nytimes.com/2019/11/30/opinion/sunday/bernie-sanders.html')
Package: nytimes-top-stories
nytimes-top-storiesis a simple Python wrapper for New York Times’ Top
Stories API.Compatible with Python 2.7 and 3+.Dependenciesnytimes-top-storiesrequires therequestspackage.InstallationPippip installnytimes-top-storiesClone repositorygit clonegit@github.com:kashiish/nytimes-top-stories.gitcdinto yournytimes-top-storiesdirectorypython setup.py installUsageRegister for a Top Stories API key athttps://developer.nytimes.com/signup.fromtopstoriesimportTopStoriesAPIapi=TopStoriesAPI(<SECRET_API_KEY>)Theget_storiesmethod takes one required argument and two optional
arguments. Checkout theAPI documentationto see the data that is
returned from the API.defget_stories(self,section,format_type="json",return_json_string=False):"""
  Gets a list of current top articles and associated images in the
  specified section and in the specified format.

  params:
      section: (string) the section the articles appears in
      format: (string) json or jsonp, default is json
      return_json_string: (boolean) if True, return value will be JSON string instead of a python list,
                          default is False
  return:
      format_type=json: A list of articles (articles are python dicts) is returned.
                        If return_json_string, string is returned.
      format_type=jsonp: API returns a callback function (string) in the format
                        "{section}TopStoriesCallback({data})".
                        {data} is an object, not an array, and it is not parsed/decoded.
  """stories=api.get_stories("politics")# list of story dictsstories_string=api.get_stories("home",return_json_string=True)# json stringstories_jsonp=api.get_stories("work",format_type="jsonp")# (string) callback function with data inputIn addition, there are two more public methods:#returns a list of valid sections>>>api.get_sections_list()>>>["home","opinion","world","national","politics","upshot","nyregion","business","technology","science","health","sports","arts","books","theater","sundayreview","fashion","tmagazine","food","travel","magazine","realestate","automobiles","obituaries","insider"]# writes a list of stories to a json file# input a path to file and list of storiesapi.write_to_json_file("example.json",stories)Testingpytestandmockare used for testing this package.python setup.py pytest
Package: nyto
nytonyto是一款輕量化的python庫，方便使用者快速開發元啟發算法(metaheuristic)訓練內建的深度學習模型。說明基於梯度下降的深度學習工具可以幫助我們快速建立並訓練深度學習模型，然而在有些情況下基於梯度下降的訓練方式可能會遇到問題，這時後我們可以借助其他優化方式來達成目的。本庫提供了一個界面，方便使用者編寫自己的元啟發算法來優化網路。而倘若你對編寫算法沒有興趣，本庫也已經內建了一個基於粒子群算法(Particle swarm optimization)的算法可供使用。詳細介紹可以查看Introduction_of_nyto，該頁面提供了使用介紹和範例程式。快速入門安裝安裝nyto需要預先安裝python3.7或更高的版本，以及pip和numpy。而通常pip會與python一起安裝。從PyPI安裝:$pipinstallnyto快速建立網路在nyto中建立網路分成兩步驟:導入模型: 可以想成是建立網路所需的零件連接節點: 可以想成是將零件組成網路fromnytoimportnet_toolastofromnytoimportlayerfromnytoimportunit_functionasuf# 導入模型my_net,node=to.new_net()node.layer1=layer.new_nn_layer((4,12))node.layer2=layer.new_nn_layer((12,3))# 連接節點node.layer1_output=node.layer1_input>>node.layer1>>uf.tanh()node.layer2_output=node.layer1_output>>node.layer2>>uf.softmax()粒子運算在nyto中，網路都是視為粒子群演算法中的粒子，當對網路做+1的操作時，網路中的所有參數都會+1。而當我們將多個網路進行粒子運算時，則可以實現元啟發算法中所有優化所需的一切功能。網路與數值運算當對網路本身進行運算時，可以視為對粒子的移動:new_net=my_net+1網路間運算當網路對網路進行運算時，可以視為對粒子進行組合:new_net=my_net+other_net取得某些節點的輸出值當想要查看特定網路中節點的輸出結果時可以使用net_tool.get來查看:fromnyto.net_toolimportgetlayer1_return,layer2_return=get(node.layer1_output,node.layer2_output)作者(jimmyzzzz)gmail:sciencestudyjimmy@gmail.comgithub:https://github.com/jimmyzzzz
Package: nyt-pyiap
Validating JWT tokens from the Google Identity-Aware Proxy as
middleware.Installpip install -e git+git@github.com:newsdev/nyt-pyiap.gitUsageDjangoAdd to settingsUpdate yoursettings.pyfile to add the Django middleware.MIDDLEWARE_CLASSES = [
  ...
  'pyiap.django.VerifyJWTMiddleware',
  ...
]Therequestobject inviews.pywill have two new attributes
added:
-request.jwt_user_id: The Google internal ID of the user who
has been verified by IAP.
-request.jwt_user_email: The email
address and email type of the user who has been verified by IAP.FlaskUpdate your Flaskapp.pyto wrap your instantiatedFlask()application’swsgi_appwith theVerifyJWTMiddleware.app = Flask(__name__)
app.wsgi_app = VerifyJWTMiddleware(app.wsgi_app)Therequest.environobject inapp.pywill have two new
attributes added:
-request.environ['jwt_user_id']: The Google
internal ID of the user who has been verified by IAP.
-request.environ['jwt_user_email']: The email address and email type
of the user who has been verified by IAP.ContributingTBD.
Package: nyt_recipe
nyt_recipeis a Python 3 script that is used to download recipes fromNYT Cookingand save them to a file in a format
that can be easily imported by Apple Notes.Installationnyt_recipeshould be installed usingpip:$python3-mpipinstallnyt-recipeUsageProvide a URL or list of URLs to the script. The script will place the output
files in therecipesdirectory inside the current user's home directory.$nyt_recipehttps://cooking.nytimes.com/recipes/1020044-vegetable-paella-with-chorizo
Savedrecipe"Vegetable Paella With Chorizo"to/Users/ianbrault/recipes/vegetable_paella_with_chorizo.htmlThen import the note into Apple Notes: "File > Import to Notes..."
Package: nytxw-puz-cli
NY Times Crossword to PuzCLI tool to convert NY Times crosswords into Across Lite files (.puz).This is a fork ofnytxw_puzwith some major differences:No browser installations are required. Authentication is performed by the program itself.Targeted for headless deployments and thus is non-interactive.Supports batch downloading with rate limiting and timeout.Usagepipinstallnytxw-puz-cli
nytxw_puz--helpCredentialsThe program expects a JSON credentials file to be passed via the--credentialsflag. The expected format of the JSON is simple and as follows:{"email":"user@domain.com","password":"my-password"}Example Using FlagsA simple example downloading a single crossword:nytxw_puz--credentialsmy-creds.creds--urlshttps://www.nytimes.com/crosswords/game/daily/2020/12/31--filenames~/puzzles/2020/12/31.puzExample Using stdinA full example of a run using cookie import/export and input ofURL,FILENAMEentries namedtasks.csvvia stdin:nytxw_puz--credentialsmy-creds.creds--import-cookiesmycookies.cookies--export-cookiesmycookies.cookies-v<tasks.csvnytxw_gennytxw_genis a small tool to help generate date ranges of crossword puzzles in CSV format to pass intonytxw_puz. For example:nytxw_gen--start2012-07-18--end2014-12-31--path-format"~/puzzles/<year>/<month>/<day>.puz">puzzles-to-download.csvDevelopmentGetting StartedThis repository usespoetryto manage dependencies and environments. To get started quickly, run:cdnytxw-puz-cli
poetryinstallCode StyleFor Python, the repository uses the default settings of theBlack code formatter.Conformance can be enforced by usingblackas follows:black<file-name>
Package: nyuclassesdl
nyuclassesdl=====_Developer: Zhiao Zhou ([@zhiaozhou](https://github.com/zhiaozhou) | <zz1749@nyu.edu> | [Linkedin](https://www.linkedin.com/in/zhiaozhou/))_nyuclassesdl is a python library for automatically downloading files from NYU Classes learning management system. And it's only available to NYU students or faculties.Now it can only download every file of all of your classes just like a git cloneDependencies=============pgmpy has following non optional dependencies:- Python 2.7 or Python 3- argparse- selenium- urllib- Geckodriver for Firefox usersInstallation=============Using pip:```$ pip install nyuclassesdl```Or for installing the latest codebase:```$ git clone https://github.com/zhiaozhou/nyuclassesdl.git$ cd nyuclassesdl/$ python setup.py install```Documentation and usage=======================Now this package can be only used with a Firefox browser installed.Then you will have to install Geckodriver from [Geckodriver/releases](https://github.com/mozilla/geckodriver/releases) and then put the executable file inside the root folder of your Firefox directory (Ex. C:\Program Files\Mozilla Firefox\)For Mac users, put it under usr/local/binThen after installing the package using pipyou can start to use it by typing nyuclassesdl [argument]| Argument | Description || :--: | :--: || --MFA | choose a way for MFA: now only "duo" is supported || --dir | choose a directory to download the files(Optional) || --un | NYU netid || --ps | NYU password |License=======NYU-Classes-downloader is released under MIT License.Keywords: nyu nyuclassesPlatform: UNKNOWNClassifier: Development Status :: 3 - AlphaClassifier: Intended Audience :: EducationClassifier: Topic :: UtilitiesClassifier: License :: OSI Approved :: MIT LicenseClassifier: Programming Language :: Python :: 2Classifier: Programming Language :: Python :: 2.7Classifier: Programming Language :: Python :: 3Classifier: Programming Language :: Python :: 3.4Classifier: Programming Language :: Python :: 3.5Classifier: Programming Language :: Python :: 3.6Classifier: Operating System :: UnixClassifier: Operating System :: POSIXClassifier: Operating System :: Microsoft :: WindowsClassifier: Operating System :: MacOS
Package: nyuki
! This package is not maintained anymore and the last version is 0.57.1 !A lightweight library designed to build nyukis (Python 3.6 only!). It provides features that shall help developers with managing the following topics while developing a nyuki:Expose features through the own nyuki RESTful APICommunication between nyukis (over HTTP and MQTT)Helpers for asyncio-based programmingThis library has been written with a focus on reliability and developer-friendliness. Its design promotes single-threaded and asynchronous coding style through the extensive use of the [Python asyncio](https://docs.python.org/3/library/asyncio.html) event loop. A single loop is used to manage HTTP and MQTT-based communications as well as executing internal logic.
Package: nyumytimecli
NYU MyTime CLIThis Python tool provides a command line interface for the NYU MyTime student employee time-tracking portal.
It is based on the Selenium library, which allows it to programmatically control a headless browser.InstallDownload this repository.gitclonehttps://github.com/matteosandrin/nyu-mytime-cliEnter the directory and install the Python package.cdnyu-mytime-cli
pipinstall.Download thechromedriverfromhttp://chromedriver.chromium.organd place it in/usr/local/bin/(This path can be modified in the configuration file).wgethttps://chromedriver.storage.googleapis.com/2.40/chromedriver_mac64.zip
unzipchromedriver_mac64.zip
cp./chromedriver/usr/local/bin/Usage# Punch into worknyu-mytimein# Punch out of worknyu-mytimeout# Set a config variablenyu-mytimeconfigVARIABLE# Verify configurationnyu-mytimeconfig