{ "info": { "author": "Shawn.Pringle", "author_email": "shawn.pringle@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "Welcome to Standard Decimal Notation's documentation!\n*****************************************************\n\nContents:\n\n... module:: qsdn\n platform:\n Unix, Windows\n\n synopsis:\n This module allows for parsing, validation and production of\n numeric literals, written with thousand separators through out\n the number. Often underlying system libraries for working with\n locales neglect to put thousand separators (commas) after the\n decimal place or they sometimes use scientific notation. The\n classes inherit from the Qt classes for making things less\n complex.\n\n Thousand separators in general will not always be commas but\n instead will be different according to the locale settings. In\n Windows for example, the user can set his thousand separator to any\n character. Support for converting strings directly to Decimals and\n from Decimals to strings is included.\n\n Also, numbers are always expressed in standard decimal notation.\n\n Care has been taken to overload all of the members in a way that is\n consistent with the base class QLocale and QValidator.\n\n This module requires PyQt5. It is presently only tested with\n Microsoft Windows. Users from other platforms are invited to join\n my team and submit pull-requests to ensure correct functioning. If\n KDE and PyKDE are installed on your system, KDE's settings for\n thousands separator and decimal symbol will be used. Otherwise the\n system's locale settings will be used to determine these values.\n\nclass qsdn.Locale(_name=None, p_mandatory_decimals=Decimal('0'), p_maximum_decimals=Decimal('Infinity'))\n\n For a Locale, locale:\n Main benefit is numbers converted to a string are always\n converted to standard decimal notation. And you control how\n far numbers are written before they are truncated. Another\n benefit is it works with decimal.Decimal numbers natively.\n So numbers get converted directly from String to Decimal and\n vice versa.\n\n To construct one, you can supply a name of a locale and specify\n the mandatory and maximum digits after the decimal point.\n\n locale = Locale(\"en_US\", 2, 3) locale.toString(4) is '4.00'\n locale.toString(4.01) is '4.01' locale.toString(1/3) is '0.333'\n\n To specify the language and script, pass in a QLocale to the\n constructor: like this: qlocale = QLocale('en_US',\n QLocale.Latin, QLocale.Spanish) sdnlocale = Locale(qlocale, 2,\n 3)\n\n To get the Decimal of a string, s, use:\n\n (d, ok) = locale.toDecimal(s, 10)\n\n The value d is your decimal, and you should check ok before\n you trust d.\n\n To get the string representation use:\n\n s = locale.toString(d)\n\n All to* routines take a string, and an optional base. If the\n base is set to zero, it will look at the first digits of the\n number to determine base it should use. So, '013' will be\n interpreted as 11 (as 0 indicates octal form) unless you set the\n base to 10, in which as it will be interpreted as 13. You can\n use '0x' to prefix hexadecimal numbers. Some developers don't\n want to expose this programming concept to the users of thier\n software. For those who don't specify the base explicitly as\n 10. As of 1.0.0, the base defaults to 10, because the new\n behavior as of PyQt5 in the QLocale class is to always have the\n base fixed as 10.\n\n By default Locale will use the settings specified in your\n default locale. This is guaranteed to be true for Mac OS,\n Windows and KDE-GUIs.\n\n static c()\n\n Returns the C locale. In the C locale, to* routines will not\n accept group separtors and do not produce them.\n\n static setDefault(QLocale)\n\n static system()\n\n Returns the system default for Locale.\n\n toDecimal(s, *, base=10)\n\n This creates a decimal representation of s.\n\n It returns an ordered pair. The first of the pair is the\n Decimal number, the second of the pair indicates whether\n the string had a valid representation of that number. You\n should always check the second of the ordered pair before\n using the decimal returned.\n\n It returns an ordered pair. The first of the pair is the\n number, the second of the pair indicates whether the string\n had a valid representation of that number. You should always\n check the second of the ordered pair before using the number\n returned.\n\n note:\n You may set another parameter, the base, so you can\n interpret the string as 8 for octal, 16 for hex, 2 for\n binary.\n\n If base is set to 0, numbers such as '0777' will be\n interpreted as octal. The string '0x33' will be interpreted\n as hexadecimal and '777' will be interpreted as a decimal.\n\n Like the other to* functions of QLocale as well as this class\n Locale, interpret a\n a string and parse it and return a Decimal. The base value\n is used to determine what base to use. It is done this way so\n this works like toLong, toInt, toFloat, etc... Leading and\n trailing whitespace is ignored.\n\n toDouble(s, *, base=10)\n\n Parses the string s and returns a floating point value whose\n string is s.\n\n It returns an ordered pair. The first of the pair is the\n number, the second of the pair indicates whether the string had\n a valid representation of that number. You should always check\n the second of the ordered pair before using the number returned.\n\n note:\n You may set another parameter, the base, so you can\n interpret the string as 8 for octal, 16 for hex, 2 for\n binary.\n\n If base is set to 0, numbers such as '0777' will be interpreted\n as octal. The string '0x33' will be interpreted as hexadecimal\n and '777' will be interpreted as a decimal.\n\n It returns an ordered pair. The first of the pair is the\n number, the second of the pair indicates whether the string\n had a valid representation of that number. You should always\n check the second of the ordered pair before using the number\n returned.\n\n toFloat(s, *, base=10)\n\n Parses the string s and returns a floating point value whose\n string is s.\n\n It returns an ordered pair. The first of the pair is the\n number, the second of the pair indicates whether the string had\n a valid representation of that number. You should always check\n the second of the ordered pair before using the number returned.\n\n note:\n You may set another parameter, the base, so you can\n interpret the string as 8 for octal, 16 for hex, 2 for\n binary.\n\n If base is set to 0, numbers such as '0777' will be interpreted\n as octal. The string '0x33' will be interpreted as hexadecimal\n and '777' will be interpreted as a decimal.\n\n toInt(s, *, base=10)\n\n Parses the string s and returns an integer value whose string is\n s.\n\n It returns an ordered pair. The first of the pair is the\n number, the second of the pair indicates whether the string had\n a valid representation of that number. You should always check\n the second of the ordered pair before using the number returned.\n\n note:\n You may set another parameter, the base, so you can\n interpret the string as 8 for octal, 16 for hex, 2 for\n binary.\n\n If base is set to 0, numbers such as '0777' will be interpreted\n as octal. The string '0x33' will be interpreted as hexadecimal\n and '777' will be interpreted as a decimal.\n\n toLongLong(s, *, base=10)\n\n Parses the string s and returns a floating point value whose\n string is s.\n\n It returns an ordered pair. The first of the pair is the\n number, the second of the pair indicates whether the string had\n a valid representation of that number. You should always check\n the second of the ordered pair before using the number returned.\n\n note:\n You may set another parameter, the base, so you can\n interpret the string as 8 for octal, 16 for hex, 2 for\n binary.\n\n If base is set to 0, numbers such as '0777' will be interpreted\n as octal. The string '0x33' will be interpreted as hexadecimal\n and '777' will be interpreted as a decimal.\n\n Leading and trailing whitespace is ignored.\n\n toShort(s, *, base=10)\n\n Parses the string s and returns a short value whose string is s.\n\n It returns an ordered pair. The first of the pair is the\n number, the second of the pair indicates whether the string had\n a valid representation of that number. You should always check\n the second of the ordered pair before using the number returned.\n\n note:\n You may set another parameter, the base, so you can\n interpret the string as 8 for octal, 16 for hex, 2 for\n binary.\n\n If base is set to 0, numbers such as '0777' will be interpreted\n as octal. The string '0x33' will be interpreted as hexadecimal\n and '777' will be interpreted as a decimal.\n\n Leading and trailing whitespace is ignored.\n\n toString(x, arg2=None, arg3=None)\n\n Convert any given Decimal, double, Date, Time, int or long to a\n string.\n\n Numbers are always converted to Standard decimal notation. That\n is to say, numbers are never converted to scientifc notation.\n\n The way toString is controlled: If passing a decimal.Decimal\n typed value, the precision is recorded in the number itself.\n So, D('4.00') will be expressed as '4.00' and not '4'. D('4')\n will be expressed as '4'.\n\n When a number passed is NOT a Decimal, numbers are created in\n the following way: Two extra parameters, set during creation of\n the locale, determines how many digits will appear in the\n result of toString(). For example, we have a number like 5.1 and\n mandatory decimals was set to 2, toString(5.1) should return\n '5.10'. A number like 6 would be '6.00'. A number like 5.104\n would depend on the maximum decimals setting, also set at\n construction of the locale: _maximum_decimals controls the\n maximum number of decimals after the decimal point So, if\n _maximum_decimals is 6 and _mandatory_decimals is 2 then\n toString(3.1415929) is '3.141,592'. Notice the number is\n truncated and not rounded. Consider rounding a copy of the\n number before displaying.\n\n toUInt(s, *, base=10)\n\n Parses the string s and returns an unsigned integer value whose\n string is s.\n\n It returns an ordered pair. The first of the pair is the\n number, the second of the pair indicates whether the string had\n a valid representation of that number. You should always check\n the second of the ordered pair before using the number returned.\n\n note:\n You may set another parameter, the base (which defaults to\n 10), so you can interpret the string as 8 for octal, 16\n for hex, 2 for binary.\n\n If base is set to 0, numbers such as '0777' will be interpreted\n as octal. The string '0x33' will be interpreted as hexadecimal\n and '777' will be interpreted as a decimal.\n\n Leading and trailing whitespace is ignored.\n\n toULongLong(s, base=10)\n\n Parses the string s and returns an unsigned long long value\n whose string is s.\n\n It returns an ordered pair. The first of the pair is the\n number, the second of the pair indicates whether the string had\n a valid representation of that number. You should always check\n the second of the ordered pair before using the number returned.\n\n note:\n You may set another parameter, the base, so you can\n interpret the string as 8 for octal, 16 for hex, 2 for\n binary.\n\n If base is set to 0, numbers such as '0777' will be interpreted\n as octal. The string '0x33' will be interpreted as hexadecimal\n and '777' will be interpreted as a decimal.\n\n Leading and trailing whitespace is ignored.\n\n toUShort(s, base=10)\n\n Parses the string s and returns a unsigned long long value whose\n string is s.\n\n It returns an ordered pair. The first of the pair is the\n number, the second of the pair indicates whether the string had\n a valid representation of that number. You should always check\n the second of the ordered pair before using the number returned.\n\n note:\n You may set another parameter, the base, so you can\n interpret the string as 8 for octal, 16 for hex, 2 for\n binary.\n\n If base is set to 0, numbers such as '0777' will be interpreted\n as octal. The string '0x33' will be interpreted as hexadecimal\n and '777' will be interpreted as a decimal.\n\n Leading and trailing whitespace is ignored.\n\nclass qsdn.NumericValidator(parent=None)\n\n NumericValidator allows for numbers of any length but\n groupSeparators are added or corrected when missing or out of\n place.\n\n U.S. dollar amounts;\n dollar = NumericValidator(6,2) s = '42.1'\n dollar.validate(s='42.1', 2) => s = '42.10' s='50000'\n dollar.toString(s) => s = ' 50,000.00'\n\n locale()\n\n get the locale used by this validator\n\n setLocale(plocale)\n\n Set the locale used by this Validator.\n\n validate(self, str, int) -> Tuple[QValidator.State, str, int]\n\nclass qsdn.LimitingNumericValidator(maximum_decamals=1000, maximum_decimals=1000, use_space=False, parent=None)\n\n NumericValidator limits the number of digits after the decimal\n point and the number of digits before.\n\n bitcoin :\n NumericValidator(8, 8) US dollars less than $1,000,000 :\n NumericValidator(6, 2)\n\n If use space is true, spaces are added on the left such that the\n location of decimal point remains constant. Numbers like\n '10,000.004', '102.126' become aligned. Bitcoin amounts:\n\n ' 0.004,3' ' 10.4' ' 320.0' '\n 0.000,004'\n\n U.S. dollar amounts;\n dollar = NumericValidator(6,2) s = '42.1'\n dollar.validate(s='42.1', 2) => s = ' 42.10'\n s='50000' dollar.toString(s) => s = '\n 50,000.00'\n\n decamals()\n\n gets the number of decimal digits that are allowed **before**\n the decimal point (apart from spaces)\n\n decimals()\n\n gets the number of decimal digits that are allowed *after* the\n decimal point\n\n locale()\n\n get the locale used by this validator\n\n setDecamals(i)\n\n sets the number of decimal digits that should be allowed\n **before** the decimal point\n\n setDecimals(i)\n\n sets the number of decimal digits that should be allowed\n **after** the decimal point\n\n setLocale(plocale)\n\n Set the locale used by this Validator.\n\n validate(s, pos)\n\n Validates s, by adjusting the position of the commas to be in\n the correct places and adjusting pos accordingly as well as\n space in order to keep decimal points aligned when varying sized\n numbers are put one above the other.\n\n\nIndices and tables\n******************\n\n* Index\n\n* Module Index\n\n* Search Page\n\n\n", "description_content_type": "text/plain", "docs_url": null, "download_url": "https://github.com/shawnpringle/separatorsafterdecimal/archive/v0.0.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/shawnpringle/separatorsafterdecimal", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "qsdn", "package_url": "https://pypi.org/project/qsdn/", "platform": "", "project_url": "https://pypi.org/project/qsdn/", "project_urls": { "Download": "https://github.com/shawnpringle/separatorsafterdecimal/archive/v0.0.0.tar.gz", "Homepage": "https://github.com/shawnpringle/separatorsafterdecimal" }, "release_url": "https://pypi.org/project/qsdn/0.0.0/", "requires_dist": [ "PyQt5" ], "requires_python": "", "summary": "Python Qt5 Classes that Display and Parse Numbers using Standard Decimal Notation", "version": "0.0.0" }, "last_serial": 5431546, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "7f3db914a8287a453c8632a471af96d0", "sha256": "10211be38f717835c6917d3a012a6eb120c4b04d11392ff29cd9049f8922b816" }, "downloads": -1, "filename": "qsdn-0.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7f3db914a8287a453c8632a471af96d0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14104, "upload_time": "2019-06-21T15:46:35", "url": "https://files.pythonhosted.org/packages/9e/dc/793d6820478acc1fcbbf111989088c410cb909f23ae9227977066fa8c15a/qsdn-0.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6586fa382803ab83d253d18d1d5ec81f", "sha256": "dea48f5fbc51af0d0e8acc677a3630826aac3c43204faf88e30555836bb6e67c" }, "downloads": -1, "filename": "qsdn-0.0.0.tar.gz", "has_sig": false, "md5_digest": "6586fa382803ab83d253d18d1d5ec81f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15300, "upload_time": "2019-06-21T15:46:38", "url": "https://files.pythonhosted.org/packages/b7/2d/d29f4d7fe7c2a47c582513eaf51b4579d67e99b9fe3a7dd0cb6c7f9cf509/qsdn-0.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7f3db914a8287a453c8632a471af96d0", "sha256": "10211be38f717835c6917d3a012a6eb120c4b04d11392ff29cd9049f8922b816" }, "downloads": -1, "filename": "qsdn-0.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7f3db914a8287a453c8632a471af96d0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14104, "upload_time": "2019-06-21T15:46:35", "url": "https://files.pythonhosted.org/packages/9e/dc/793d6820478acc1fcbbf111989088c410cb909f23ae9227977066fa8c15a/qsdn-0.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6586fa382803ab83d253d18d1d5ec81f", "sha256": "dea48f5fbc51af0d0e8acc677a3630826aac3c43204faf88e30555836bb6e67c" }, "downloads": -1, "filename": "qsdn-0.0.0.tar.gz", "has_sig": false, "md5_digest": "6586fa382803ab83d253d18d1d5ec81f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15300, "upload_time": "2019-06-21T15:46:38", "url": "https://files.pythonhosted.org/packages/b7/2d/d29f4d7fe7c2a47c582513eaf51b4579d67e99b9fe3a7dd0cb6c7f9cf509/qsdn-0.0.0.tar.gz" } ] }