Giter Club home page Giter Club logo

python-smsfly's Introduction

python-smsfly's People

Contributors

ghostku avatar waffle-iron avatar webknjaz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

python-smsfly's Issues

ModuleNotFoundError: No module named 'smsfly'

What am I doing wrong? The same error with Windows 10 and with Ubuntu

C:\Users\ghost
λ python --version
Python 3.7.1

C:\Users\ghost
λ python -m pip freeze | grep 'SMS'
SMSFly==0.1.5

C:\Users\ghost
λ python
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from smsfly import SMSFlyAPI
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'smsfly'
>>>`

Use UTF-8 for Cyrillic messages

*** smsfly.py   2017-01-29 02:59:07.967282733 +0200
--- smsfly_utf.py       2016-10-29 06:08:21.000000000 +0300
***************
*** 23,28 ****
--- 23,29 ----
      @parse_xml_response
      def __request(self, request_xml_body):
          req_body = str(request_xml_body)
+         req_body = req_body.encode("utf-8")
          logger.debug('Submitting POST request to SMS-Fly API {}.\nRequest body: {}'.
                       format(self.API_URL, req_body))
          return self.__http.post(self.API_URL, data=req_body)

Set up development tools

  • pre-commit. Here's an example of .pre-commit-config.yaml
- repo: https://github.com/pre-commit/pre-commit-hooks
  sha: master
  hooks:
  - id: trailing-whitespace
    exclude: wargaming|bigworld|saber/(server|template|tools|transport|scripts/(common/(TemplateData|pydev|bwpydevd.py$)|surrogates))
  - id: check-merge-conflict
    exclude: wargaming|bigworld|saber/(server|template|tools|transport|scripts/(common/(TemplateData|pydev|bwpydevd.py$)|surrogates))
  - id: double-quote-string-fixer
    exclude: wargaming|bigworld|saber/(server|template|tools|transport|scripts/(common/(TemplateData|pydev|bwpydevd.py$)|surrogates))
  - id: end-of-file-fixer
    exclude: wargaming|bigworld|saber/(server|template|tools|transport|scripts/(common/(TemplateData|pydev|bwpydevd.py$)|surrogates))
  # - id: fix-encoding-pragma
  #   exclude: wargaming|bigworld|saber/(server|template|tools|transport|scripts/(common/(TemplateData|pydev|bwpydevd.py$)|surrogates))
  - id: check-xml
    exclude: wargaming|bigworld|saber/(tools|transport|scripts/(common/(TemplateData|pydev|bwpydevd.py$)|surrogates))
  - id: name-tests-test
    exclude: wargaming|bigworld|saber/(server|template|tools|transport|scripts/(common/(TemplateData|pydev|bwpydevd.py$)|surrogates))
  - id: flake8
    exclude: wargaming|bigworld|saber/(server|template|tools|transport|scripts/(common/(TemplateData|pydev|bwpydevd.py$|Transport/Generated)|surrogates))
  - id: debug-statements
    exclude: wargaming|bigworld|saber/(server|template|tools|transport|scripts/(common/(TemplateData|pydev|bwpydevd.py$)|surrogates))
  • vagga
  • maybe tox to test code against several python versions

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

requirements.txt

Add runtime requirements into setup.py (likely) and add dev/test requirements into some requirements.txt infrastructure.

N.B. to make requirements.txt depend on setup.py's requirements, add -e . requirement

Implement basic API class

  • Accept credentials in constructor
  • Fallback to credentials in environment variables
  • Make API calls using requests package
  • Parse XML using beautifulsoup (optionally) with lxml (probably)
  • Implement calls to all API methods
  • Implement own exception hierarchy

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.