Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

METADATA 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. Metadata-Version: 2.0
  2. Name: sqlparse
  3. Version: 0.2.4
  4. Summary: Non-validating SQL parser
  5. Home-page: https://github.com/andialbrecht/sqlparse
  6. Author: Andi Albrecht
  7. Author-email: albrecht.andi@gmail.com
  8. License: BSD
  9. Platform: UNKNOWN
  10. Classifier: Development Status :: 4 - Beta
  11. Classifier: Intended Audience :: Developers
  12. Classifier: License :: OSI Approved :: BSD License
  13. Classifier: Operating System :: OS Independent
  14. Classifier: Programming Language :: Python
  15. Classifier: Programming Language :: Python :: 2
  16. Classifier: Programming Language :: Python :: 2.7
  17. Classifier: Programming Language :: Python :: 3
  18. Classifier: Programming Language :: Python :: 3.3
  19. Classifier: Programming Language :: Python :: 3.4
  20. Classifier: Programming Language :: Python :: 3.5
  21. Classifier: Programming Language :: Python :: 3.6
  22. Classifier: Topic :: Database
  23. Classifier: Topic :: Software Development
  24. ``sqlparse`` is a non-validating SQL parser module.
  25. It provides support for parsing, splitting and formatting SQL statements.
  26. Visit the `project page <https://github.com/andialbrecht/sqlparse>`_ for
  27. additional information and documentation.
  28. **Example Usage**
  29. Splitting SQL statements::
  30. >>> import sqlparse
  31. >>> sqlparse.split('select * from foo; select * from bar;')
  32. [u'select * from foo; ', u'select * from bar;']
  33. Formatting statemtents::
  34. >>> sql = 'select * from foo where id in (select id from bar);'
  35. >>> print sqlparse.format(sql, reindent=True, keyword_case='upper')
  36. SELECT *
  37. FROM foo
  38. WHERE id IN
  39. (SELECT id
  40. FROM bar);
  41. Parsing::
  42. >>> sql = 'select * from someschema.mytable where id = 1'
  43. >>> res = sqlparse.parse(sql)
  44. >>> res
  45. (<Statement 'select...' at 0x9ad08ec>,)
  46. >>> stmt = res[0]
  47. >>> str(stmt) # converting it back to unicode
  48. 'select * from someschema.mytable where id = 1'
  49. >>> # This is how the internal representation looks like:
  50. >>> stmt.tokens
  51. (<DML 'select' at 0x9b63c34>,
  52. <Whitespace ' ' at 0x9b63e8c>,
  53. <Operator '*' at 0x9b63e64>,
  54. <Whitespace ' ' at 0x9b63c5c>,
  55. <Keyword 'from' at 0x9b63c84>,
  56. <Whitespace ' ' at 0x9b63cd4>,
  57. <Identifier 'somes...' at 0x9b5c62c>,
  58. <Whitespace ' ' at 0x9b63f04>,
  59. <Where 'where ...' at 0x9b5caac>)