GithubHelp home page GithubHelp logo

whatamithinking / allacronyms Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 4.0 129 KB

An unofficial api to allacronyms.com. Lookup / expand abbreviations. Lookup definitions of abbreviations.

License: MIT License

Python 100.00%
allacronyms python3 abbreviations xpansion abbreviation-expansion unofficial-apis acronyms

allacronyms's Introduction

AllAcronyms Unofficial API

An unofficial api to allacronyms.com. Lookup / expand abbreviations. Lookup definitions of abbreviations.

Attributes / Methods

  • categories : Get a list of categories abbreviations can fall under / be searched under.
  • getTopics : Search for topics an abbreviation / definition falls under.
    • Keywords : string of keywords for either an abbreviation / definition you want to search for
    • Category : The category to search for the topics under
  • search : Search for an abbreviation / definition ( automatically detected which one you enter )
    • Keywords : The abbreviation / definition to search for.
    • Category : The category to search under.
    • Topic : The topic to filter the results by.
    • Quantity : the number of abbreviations to return. Defaults to 1.
  • getRandom : get random abbreviations list

Classes / Objects

  • AllAcronyms : the main class for querying the site.
  • Abbreviation : named tuple that stores info related to each abbreviation.
    • rating : the rating given to an abbreviation by the users of AllAcronyms.com.
    • confidence : the confidence ( ratio of this abbreviation's rating to sum of ratings returned in search results )
    • definition : the definition of the abbreviation
    • abb : the abbreviation

Installation

pip install git+git://github.com/ConnorSMaynes/allacronyms

Usage

from allacronyms import AllAcronyms

from tabulate import tabulate
acron = AllAcronyms()

# GET RANDOM ABBREVIATION
Abbs = acron.getRandom()
print( tabulate( Abbs, headers=Abbs[0]._fields ) )

# GET LIST OF AVAILABLE CATEGORIES
Categories = acron.categories
print( tabulate( [ [ x ] for x in Categories ], headers=['Categories'] ) )

# SEARCH FOR DEFINITION
Abb = acron.search( Keywords='FOR'
                  ,Category='Organizations'
                  ,Topic='Friendship' )
if Abb != None:
    print( Abb.definition )

# SEARCH FOR ABBREVIATION
Abb = acron.search( Keywords='Application Programming Interface' )
if Abb != None:
    print( Abb.abb )
    print( Abb.definition )

# SEARCH FOR TOPICS ABBREVIATION / DEFINITION FALLS UNDER
Topics = acron.getTopics( Keywords='Peanut Butter and Jelly' )
print( tabulate( [ [ x ] for x in Topics ], headers=['Topics'] ) )

# SEARCH FOR TOP ABBREVIATIONS / DEFINITIONS
Abbs = acron.search( Keywords='YOLO', Quantity=10 )
if len( Abbs ) > 0:
    print( tabulate( Abbs, headers=Abbs[0]._fields ) )

Similar Projects

This project was inspired by others:

License

Copyright © 2018, ConnorSMaynes. Released under the MIT.

allacronyms's People

Contributors

whatamithinking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.