- Fixed
funpayparsers.parsers.page_parsers.SubcategoryPageParser: fieldscategory_idandsubcategory_id.
- Added
funpayparsers.message_type_re: list of compiled regular expressions for FunPay system messages. - Added
funpayparsers.types.enums.MessageType: FunPay system message types enumeration. - Added
funpayparsers.types.messages.Message.type: field, that contains message type. funpayparsers.types.enums.SubcategoryTypemembers now have 2 fields:showcase_aliasandurl_alias. Usingvalueof a member marked as deprecated.funpayparsers.types.enums.Languagemembers now have 3 fields:url_alias,appdata_aliasandheader_menu_css_class. Usingvalueof a member marked as deprecated.
funpayparsers.types.messages.Message.chat_namenow has typestr | Noneinstead ofstr.
- Using
valueoffunpayparsers.types.enums.SubcategoryTypemembers is deprecated. Useshowcase_aliasorurl_aliasof members instead. - Using
valueoffunpayparsers.types.enums.Languagemembers is deprecated. Useurl_alias,appdata_aliasorheader_menu_css_classof members instead.
- Members of
funpayparsers.types.enums.SubcategoryTypeandfunpayparsers.types.enums.Languagenow use frozen dataclasses as their values instead of relying on custom__new__logic in Enums. - Accessing enum fields now requires
.value, e.g.:Language.RU.value.url_alias
- All
get_by_...class methods in all enums have been converted to@staticmethods.
Note
These changes were introduced to improve code maintainability and better align with the Single Responsibility Principle (SRP). While ideally the
get_by_...logic would reside outside the Enums (in dedicated resolvers), keeping them as static methods within the enum classes is a deliberate compromise for simplicity — given their limited number and scope.Using dataclasses for enum values simplifies internal logic, improves clarity, and provides better support for type checkers like
mypy.This design is currently considered a balanced trade-off between architectural purity and practical readability.
- Added
@classmethodfrom_raw_sourcetoFunPayObject. RaisesNotImplementedErrorby default. - Implemented
from_raw_sourcein all page-types. - Added
timestampproperty tofunpayparsers.types.Message.
- Improved
funpayparsers.parsers.utils.parse_date_string: added new patterns of dates. - Improved
funpayparsers.parsers.utils.resolve_messages_senders: fieldsend_date_textof heading message now propagates on messages below it.
- Added new object
funpayparses.types.messages.MessageMetaand related parserfunpayparsers.parsers.message_meta_parser.MessageMetaParser.MessageMetacontains meta info about message, such is message type and mentioned seller / buyer / admin / order (if it is system message).MessageMetaParseraccepts inner html of message (inner html ofdiv.chat-msg-text) and returnsMessageMetaobject.
funpayparsers.types.messages.Message.typemoved tofunpayparsers.types.messages.Message.meta.type
funpayparsers.parsers.messages_parser.MessagesParserdoesn't strip message texts anymore.
funpayparsers.parsers.page_parsers.subcategory_page_parser.SubCategoryPageParsernow can parse anonymous response.
funpayparsers.exceptions.ParsingErrornow shorts HTML in error message if it longer than 500 symbols.
funpayparsers.parsers.utils.parse_date_stringnow respects machines timezone.
- Added property
pricetofunpayparsers.types.offers.OfferFields.
funpayparsers.parsers.offer_fields_parser.OfferFieldsParsernow can parse offer fields from full page HTML.
- Added new badge type:
funpayparsers.types.enums.BadgeType.NOT_ACTIVATED(#88) - Improved
funpayparsers.types.offers.OfferFields- Added new methods:
- Method
.convert_to_currencythat convertsOfferFieldsinstance to currency-type fields. - Method
.convert_to_commonthat convertsOfferFieldsinstance to common-type fields. - Method
.get_currency_amountthat returns currency amount of specified currency. Applicable for currency-type offers only. - Method
.set_currency_amountthat sets currency amount of specified currency. Applicable for currency-type offers only. - Method
.get_currency_pricethat returns currency price of specified currency. Applicable for currency-type offers only. - Method
.set_currency_pricethat sets currency price of specified currency. Applicable for currency-type offers only. - Method
.get_currency_statusthat returns currency active status of specified currency. Applicable for currency-type offers only. - Method
.set_currency_statusthat sets currency active status of specified currency. Applicable for currency-type offers only.
- Method
- Added new
@property's:- Property
.is_currency, that indicates whetherOfferFieldsinstance is currency-type or not. - Property
.is_common, that indicates whetherOfferFieldsinstance is common-type or not. - Property
.subcategory_id(field name:chipfor currency-type,node_idfor common-type offers). - Property
.category_id(field name:game, applicable for currency-type offers only). - Property
.min_sum(field name:chip_min_sum, applicable for currency-type offers only). - Property
.offer_id(field name:offer_id, applicable for common-type offers only). - Property
.price(field name:price, applicable for common-type offers only).
- Property
- Added type checks to existing
@property's. Some properties are applicable for currency-type offers only, some for common-type offers only. - Improved doc-strings.
- Added new methods:
- Added timestamp
@property's to objects with date fields (returns0if an error occurred while parsing date text):funpayparsers.types.chat.PrivateChatInfo.registration_timestamp.funpayparsers.types.finances.TransactionPreview.timestamp.funpayparsers.types.offers.OfferSeller.registration_timestamp.funpayparsers.types.reviews.Review.timestamp(available only for owned reviews).
funpayparsers.types.offers.OfferFields.set_fieldnow automatically converts value intostr.funpayparsers.types.offers.OfferFieldsnow automatically removescsrf_tokenfield after initialization (in__post_init__).- Improved
funpayparsers.parsers.utils.parse_date_string:- Removed redundant regular expressions.
- Optimized existing regular expressions.
- Added support of new time formats (review time format for all languages).
- Added related tests.
- Removed
funpayparsers.types.offers.OfferFields.csrf_token. funpayparsers.types.offers.OfferSeller.register_date_textchanged tofunpayparsers.types.offers.OfferSeller.registration_date_text.funpayparsers.types.reviews.Review.time_ago_strchanged tofunpayparsers.types.reviews.Review.date_text.
funpayparsers.parsers.page_parsers.transactions_page_parserupdated for new transactions page.
- Added
sales_availablefield tofunpayparsers.types.common_page_elements.PageHeader. - Added parsing of
sales_availablefield.
- Added
logout_tokentofunpayparsers.types.common_page_elements.PageHeader. - Added parsing of
logout_tokenfield.
- Added
funpayparsers.types.settings.Settingstype. - Added
funpayparsers.types.pages.settings_page.SettingsPagetype. - Added
funpayparsers.parsers.page_parsers.settings_page_parser.SettingsPageParser.
- Added spaces to word separators in date parsing tests.
- Added
funpayparsers.types.pages.offer_page.OfferPagetype. - Added
funpayparsers.types.common.DetailedUserBalancetype. - Added
funpayparsers.types.common.PaymentOptiontype. - Added
funpayparsers.parsers.page_parsers.OfferPageParserparser.
funpayparsers.parsers.utils.parse_money_value_stringnow can parser money value strings with more than 1 currency characters (e.g.,USDT.)
- Fixed
funpayparsers.parsers.offer_previews_parser.OfferPreviewsParser: now it can parse offer previews from my offers page.
- Added field
.unittofunpayparsers.types.offers.OfferPreview. - Added parsing of unit field in offer preview.
- Added field
.fields_namestofunpayparsers.types.offers.OfferFields, that contains field ID to field human-readable name mapping. - Added parsing of
.fields_names.
NEW_ORDERregular expression now covers currency orders.
- Added
SubcategoryType.CHIPS. - Added
SubcategoryType.OFFER.
- Deprecated
SubcategoryType.CURRENCY. - Deprecated
SubcategoryType.COMMON.